As per this documentation
Liquibase
can execute multiple sql
files in a given path without the need of any changelogs. However when I created the file with below inserts
insert into address (id, line1, line2) values (1, '121 Main Ave', null);
insert into address (id, line1, line2) values (2, '662 Broadway', 'Suite 3317');
insert into address (id, line1, line2) values (3, '412 Riverview', null);
I get the following error
Invalid
sql
syntax
Liquibase tracks changes using its own tables in your schema to ensure consistency and to avoid corruption due to incorrectly altered changelogs. It records a hash of each changeset. While it's running updates, it puts a "lock" on your database so you can't accidentally run two changelogs concurrently.
Managing Stored Procedures: Try to maintain separate changelog for Stored Procedures and use runOnChange=”true”. This flag forces LiquiBase to check if the changeset was modified. If so, liquibase executes the change again. What do they mean by "maintain separate changelog for stored procedures"?
What are the supported features of the Liquibase Cloud Spanner extension? The Cloud Spanner Liquibase extension allows you to use Liquibase to target Cloud Spanner databases. The extension supports most of the available features of both Liquibase and Cloud Spanner and supports most DML and DDL commands.
The runOnChange changeset attribute runs the change the first time it is detected and each time the changeset is modified. Liquibase determines that a changeset has been modified by comparing the MD5 checksum for the changeset to the checksum stored in the DATABASECHANGELOG table.
Liquibase is not recognising your sql file . Add these 2 lines on top of you sql file :
--liquibase formatted sql
--changeset {authorName}:{id}
change authorName and id as per your wish . You can also do something like this in your changelog.xml file:
<changeSet author="authorName" id=”id”>
<sqlFile path="insertcommands.sql"/>
</changeSet>
In this case you need not put on top of your insertcommands.sql file
--liquibase formatted sql
--changeset {authorName}:{id}
as you did earlier.
PS - Tested on liquibase-3.4 and mysql5.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With