mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-30 23:01:34 +00:00
refactor: relocate db scripts
This commit is contained in:
parent
9d4c08e460
commit
409d0c4ffd
2
.gitignore
vendored
2
.gitignore
vendored
@ -62,8 +62,6 @@ package-lock.json
|
|||||||
.node-version
|
.node-version
|
||||||
.nvmrc
|
.nvmrc
|
||||||
!.gitkeep
|
!.gitkeep
|
||||||
/start.json
|
|
||||||
/migrate.js
|
|
||||||
|
|
||||||
# User directories (renders)
|
# User directories (renders)
|
||||||
/public/render/**/original
|
/public/render/**/original
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const init = async db => {
|
const initDatabase = async db => {
|
||||||
// Create the tables we need to store galleries and files
|
// Create the tables we need to store galleries and files
|
||||||
await db.schema.hasTable('albums').then(exists => {
|
await db.schema.hasTable('albums').then(exists => {
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
@ -63,10 +63,10 @@ const init = async db => {
|
|||||||
password: hash,
|
password: hash,
|
||||||
token: require('randomstring').generate(64),
|
token: require('randomstring').generate(64),
|
||||||
timestamp,
|
timestamp,
|
||||||
permission: require('./../controllers/permissionController').permissions.superadmin,
|
permission: require('./../permissionController').permissions.superadmin,
|
||||||
registration: timestamp
|
registration: timestamp
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = init
|
module.exports = initDatabase
|
@ -21,7 +21,7 @@
|
|||||||
"watch": "gulp watch",
|
"watch": "gulp watch",
|
||||||
"develop": "env NODE_ENV=development gulp watch",
|
"develop": "env NODE_ENV=development gulp watch",
|
||||||
"dev": "env NODE_ENV=development gulp watch",
|
"dev": "env NODE_ENV=development gulp watch",
|
||||||
"migrate": "node ./database/migration.js",
|
"migrate": "node ./scripts/migrate.js",
|
||||||
"bump-versions": "node ./scripts/bump-versions.js",
|
"bump-versions": "node ./scripts/bump-versions.js",
|
||||||
"cf-purge": "node ./scripts/cf-purge.js",
|
"cf-purge": "node ./scripts/cf-purge.js",
|
||||||
"clean-up": "node ./scripts/clean-up.js",
|
"clean-up": "node ./scripts/clean-up.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user