diff --git a/box-site.json b/box-site.json index 96e3c91fb..e16b5cd07 100644 --- a/box-site.json +++ b/box-site.json @@ -44,7 +44,6 @@ "contentbox:migrate" : "migrate up manager=contentbox", "contentbox:migrate:up" : "run-script contentbox:migrate", "contentbox:migrate:down" : "migrate down manager=contentbox", - "install:2021":"!cfpm install zip,orm,mysql,postgresql,sqlserver,document,feed", "format":"cfformat run config/,handlers/,models/,modules_app/**/*.cfc,Application.cfc --overwrite", "format:watch":"cfformat watch config/,handlers/,models/,modules_app/**/*.cfc,Application.cfc ./.cfformat.json", "format:check":"cfformat check config/**/*.cfc,modules_app/**/*.cfc,modules/contentbox/**/*.cfc,tests/**/*.cfc,Application.cfc" diff --git a/modules/contentbox/migrations/2020_01_01_150933_init.cfc b/modules/contentbox/migrations/2020_01_01_150933_init.cfc index 7637dd395..b03813354 100755 --- a/modules/contentbox/migrations/2020_01_01_150933_init.cfc +++ b/modules/contentbox/migrations/2020_01_01_150933_init.cfc @@ -48,32 +48,32 @@ component { ]; systemOutput( "Starting to initialize the ContentBox Database, this will take a while...", true ); - var newDB = false; migrations.each( ( migration, record ) => { systemOutput( "Migrating [#migration#]...", true ); if ( !schema.hasTable( record.table ) ) { - newDB = true; systemOutput( "- Table doesn't exist (#record.table#) creating it...", true ); new "init.create_#migration#"( ).up( schema, query ); + + // Seeding Permissions + if( migration == "permissions" ){ + systemOutput( "- Seeding permissions...", true ); + new init.seed_permissions().seed( schema, query ); + } + + // Seeding Roles + if( migration == "roles" ){ + systemOutput( "- Seeding roles...", true ); + new init.seed_roles().seed( schema, query ); + } + } else { systemOutput( "√ Table (#record.table#) already exists, skipping...", true ); } } ); systemOutput( "√ Database structure complete", true ); - - // Seed the database only if we created the tables - // This protects agains seeding an already ran migration - if ( newDB ) { - systemOutput( "- Database seeding required, starting...", true ); - - new init.seed_permissions().seed( schema, query ); - new init.seed_roles().seed( schema, query ); - - systemOutput( "√ Database seeding completed", true ); - } } function down( schema, query ){