Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to apply migration from two different sql files #300

Open
AnizMNizar opened this issue Mar 25, 2023 · 1 comment
Open

Unable to apply migration from two different sql files #300

AnizMNizar opened this issue Mar 25, 2023 · 1 comment

Comments

@AnizMNizar
Copy link

I am using evolve to create schema, tables and some application meta data from CI/CD server. The migration script is spilt into two files , first one for creating schema and tables and the second sql file contains INSERT statements for the data. I am using the dotnet tool commands as below:

`evolve migrate postgresql -c "Server=${RDS_DB_HOST};Database=${USER_SERVICE_DB_NAME};User Id=${RDS_DB_ADMIN_USER};Password=${RDS_DB_ADMIN_PWD};" -l "$(pwd)/UserService/db-scripts/create-user-schema/" -p USER_SERVICE_DB_USER:${USER_SERVICE_DB_USER} -p USER_SERVICE_DB_PWD:${USER_SERVICE_DB_PWD} -p USER_SERVICE_DB_SCHEMA:${USER_SERVICE_DB_SCHEMA}

echo 'Finished migration of schema, functions and tables'

evolve migrate postgresql -c "Server=${RDS_DB_HOST};Database=${USER_SERVICE_DB_NAME};User Id=${RDS_DB_ADMIN_USER};Password=${RDS_DB_ADMIN_PWD};" -l "$(pwd)/UserService/db-scripts/create-user-data/" -p USER_SERVICE_DB_SCHEMA:${USER_SERVICE_DB_SCHEMA}

echo 'Finished migration of data'`

The first migration is applied successfully, schema and tables are created successfully. But the second migration gives error:
Validate failed: invalid checksum for migration: V1_0_0_0__Create_user_data.sql.
I tried using repair , it gives no error when I use repair, but it doesn't execute the sql script.

How can I resolve this issue ? I don't want to use a single sql file for the migration.

@lecaillon
Copy link
Owner

Each of your script must have a different name/version wheter it is in the same folder or not : https://evolve-db.netlify.app/concepts/

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

No branches or pull requests

2 participants