Add new script for fleetdm.com schema migrations (#1317)

* Make sails run wipe-staging just be sails run wipe.

* Add instructions to README

* use latest postgresql adapter + update wipe script  (will probably change this to mysql at some point for consistency)

* Update README.md
This commit is contained in:
Mike McNeil 2021-07-06 21:58:20 -05:00 committed by GitHub
parent 41cfaa1e76
commit f5f751fdd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

9
website/README.md vendored
View File

@ -20,6 +20,15 @@ sails lift
Your local copy of the website is now running at [http://localhost:2024](http://localhost:2024)!
## Wipe the production database
I hope you know what you're doing. The easiest kind of database schema migration:
```sh
sails_datastores__default__url='REAL_DB_URI_HERE' sails run wipe
```
Then when you see the sailboat, hit `CTRL+C` to exit. All done!
## Bugs
To report a bug or make a suggestion for the website, [click here](https://github.com/fleetdm/fleet/issues).

View File

@ -13,7 +13,7 @@
"sails-hook-organics": "^2.0.0",
"sails-hook-orm": "^2.1.1",
"sails-hook-sockets": "^2.0.0",
"sails-postgresql": "^1.0.2"
"sails-postgresql": "^2.0.0"
},
"devDependencies": {
"cheerio": "0.18.0",
@ -31,7 +31,7 @@
"lint": "./node_modules/eslint/bin/eslint.js . --max-warnings=0 --report-unused-disable-directives && echo '✔ Your .js files look so good.' && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/**/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/**/**/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/pages/**/**/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/pages/**/**/**/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/pages/**/**/**/**/*.ejs && ./node_modules/htmlhint/bin/htmlhint -c ./.htmlhintrc views/pages/**/**/**/**/**/*.ejs && echo '✔ So do your .ejs files.' && ./node_modules/lesshint/bin/lesshint assets/styles/ --max-warnings=0 && echo '✔ Your .less files look good, too.'",
"start": "NODE_ENV=production node app.js",
"test": "npm run lint && npm run custom-tests && echo 'Done.'",
"wipe-staging": "sails_datastores__default__adapter=sails-postgresql sails_datastores__default__ssl=true sails_datastores__default__url='REAL_DB_URI_HERE' sails lift --drop"
"wipe": "sails_datastores__default__adapter=sails-postgresql sails_datastores__default__ssl='{ \"rejectUnauthorized\": false }' sails lift --drop"
},
"main": "app.js",
"repository": {