Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12339910
db.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
db.go
View Options
/*
* Copyright © 2020-2021 Musing Studio LLC.
*
* This file is part of WriteFreely.
*
* WriteFreely is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, included
* in the LICENSE file in this source code package.
*/
package
main
import
(
"github.com/urfave/cli/v2"
"github.com/writefreely/writefreely"
)
var
(
cmdDB
cli
.
Command
=
cli
.
Command
{
Name
:
"db"
,
Usage
:
"db management tools"
,
Subcommands
:
[]
*
cli
.
Command
{
&
cmdDBInit
,
&
cmdDBMigrate
,
},
}
cmdDBInit
cli
.
Command
=
cli
.
Command
{
Name
:
"init"
,
Usage
:
"Initialize Database"
,
Action
:
initDBAction
,
}
cmdDBMigrate
cli
.
Command
=
cli
.
Command
{
Name
:
"migrate"
,
Usage
:
"Migrate Database"
,
Action
:
migrateDBAction
,
}
)
func
initDBAction
(
c
*
cli
.
Context
)
error
{
app
:=
writefreely
.
NewApp
(
c
.
String
(
"c"
))
return
writefreely
.
CreateSchema
(
app
)
}
func
migrateDBAction
(
c
*
cli
.
Context
)
error
{
app
:=
writefreely
.
NewApp
(
c
.
String
(
"c"
))
return
writefreely
.
Migrate
(
app
)
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 15, 10:37 AM (17 h, 22 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3491803
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment