chore: Migrate authentication to new tables (#1929)
This work provides a foundation for a more pluggable authentication system such as the one outlined in #1317. closes #1317
This commit is contained in:
21
server/utils/startup.js
Normal file
21
server/utils/startup.js
Normal file
@ -0,0 +1,21 @@
|
||||
// @flow
|
||||
import { Team, AuthenticationProvider } from "../models";
|
||||
|
||||
export async function checkMigrations() {
|
||||
if (process.env.DEPLOYMENT === "hosted") {
|
||||
return;
|
||||
}
|
||||
|
||||
const teams = await Team.count();
|
||||
const providers = await AuthenticationProvider.count();
|
||||
|
||||
if (teams && !providers) {
|
||||
console.error(`
|
||||
This version of Outline cannot start until a data migration is complete.
|
||||
Backup your database, run the database migrations and the following script:
|
||||
|
||||
$ node ./build/server/scripts/20210226232041-migrate-authentication.js
|
||||
`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user