Skip to content

CI + vagrant DB: use data only dumps instead of full schemas - #1076

Open
afk11 wants to merge 1 commit into
mainfrom
ci-data-sql
Open

CI + vagrant DB: use data only dumps instead of full schemas #1076
afk11 wants to merge 1 commit into
mainfrom
ci-data-sql

Conversation

@afk11

@afk11 afk11 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Going back a few years the project maintained full database dumps (ie, data and schema included) for the vagrant developer VM, and the CI test database

As found in #1072 - some differences had cropped up. Mainly it was our CI database that had drifted. the vagrant VM largely matched migrations.

Both the CI and vagrant environments have test data that is relied upon one way or the other. So to make sure the schemas can't drift, this PR replaces day-to-day use of full schemas with migrations and data-only dumps.

That being said, in the vagrant env, we do continue to support providing a .sql full schema dump to boot from as it can aid development. So if a full schema dump is provided, it'll be imported preferentially, and the data-only dump will be ignored.

With this change, I also have a corresponding PR for the developer documentation inex/ixp-manager-docs-md#31

# provide a full schema dump for ixp_ci database:
    default: Setting up MySQL and databases...
    default: No full schema dumps (vagrant) to import
    default: Importing ci_test_db.sql. Full database dump expected.
    default: Installing composer.phar...
    default: Installing composer packages...
    default: Installing / migrating database...
    default: Importing vagrant sample data

# provide a full schema dump for ixp database:
    default: Setting up MySQL and databases...
    default: Importing ixpmanager-preferred.sql. Full database dump expected.
    default: No full schema dumps (CI) to import
    default: Installing composer.phar...
    default: Installing composer packages...
    default: Installing / migrating database...
    default: Importing CI sample data

# no overrides, use data dumps on top of migrations.
    default: Setting up MySQL and databases...
    default: No full schema dumps (vagrant) to import
    default: No full schema dumps (CI) to import
    default: Installing composer.phar...
    default: Installing composer packages...
    default: Installing / migrating database...
    default: Importing vagrant sample data
    default: Importing CI sample data

…grations to provide structure. Update github workflow and vagrant bootstrap.sh. Providing a full schema dump for CI and vagrant is still supported.
@barryo

barryo commented Aug 21, 2026

Copy link
Copy Markdown
Member

Thanks @afk11 - makes sense.

I wonder can we improve on the CI element with database seeders so we can reset in one command like php artisan migrate:fresh --seed.

We could also then build this into the tests via https://laravel.com/framework/docs/database-testing#resetting-the-database-after-each-test

If you would like to totally reset the database, you may use the Illuminate\Foundation\Testing\DatabaseMigrations or Illuminate\Foundation\Testing\DatabaseTruncation traits instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants