Skip to content

Commit 68ad19d

Browse files
authored
Merge pull request #25 from jasonlyle88/sqlcl_24_1_0_additions
Sqlcl 24.1.0 additions
2 parents 79a59cd + a8844dd commit 68ad19d

File tree

10 files changed

+86
-6
lines changed

10 files changed

+86
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ "&2/sqlcl-liquibase-default-file-relative-to-script-absolute/script.sql"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:ora="http://www.oracle.com/xml/ns/dbchangelog-ext"
6+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.17.xsd"
7+
>
8+
<changeSet
9+
id="something"
10+
author="jlyle"
11+
runOnChange="true"
12+
runAlways="true"
13+
>
14+
<output>Run successfully!</output>
15+
</changeSet>
16+
</databaseChangeLog>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
liquibase.command.contexts=runme
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- Make sure the liquibase changelog table exists
2+
liquibase validate -database-changelog-table-name &1._changelog -changelog-file changelog.xml
3+
4+
-- Call to see if functionality works
5+
liquibase update -database-changelog-table-name &1._changelog -changelog-file changelog.xml -defaults-file liquibase.properties
6+
7+
-- See if any changesets were run
8+
declare
9+
c_table_name constant varchar2(255 char) := '&1._changelog';
10+
l_count number;
11+
begin
12+
execute immediate 'select count(1) from ' || c_table_name
13+
into l_count;
14+
15+
if l_count = 0 then
16+
raise_application_error(-20001, 'Liquibase update did not run');
17+
end if;
18+
end;
19+
/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ "sqlcl-liquibase-default-file-relative-to-script-relative/script.sql"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:ora="http://www.oracle.com/xml/ns/dbchangelog-ext"
6+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.17.xsd"
7+
>
8+
<changeSet
9+
id="something"
10+
author="jlyle"
11+
runOnChange="true"
12+
runAlways="true"
13+
>
14+
<output>Run successfully!</output>
15+
</changeSet>
16+
</databaseChangeLog>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
liquibase.command.contexts=runme
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- Make sure the liquibase changelog table exists
2+
liquibase validate -database-changelog-table-name &1._changelog -changelog-file changelog.xml
3+
4+
-- Call to see if functionality works
5+
liquibase update -database-changelog-table-name &1._changelog -changelog-file changelog.xml -defaults-file liquibase.properties
6+
7+
-- See if any changesets were run
8+
declare
9+
c_table_name constant varchar2(255 char) := '&1._changelog';
10+
l_count number;
11+
begin
12+
execute immediate 'select count(1) from ' || c_table_name
13+
into l_count;
14+
15+
if l_count = 0 then
16+
raise_application_error(-20001, 'Liquibase update did not run');
17+
end if;
18+
end;
19+
/

source/sqlcl_direct_unit_tests/sqlcl-liquibase-defaults-file-respected/changelog.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,27 @@
66
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.17.xsd"
77
>
88
<changeSet
9+
id="test_1"
910
author="jlyle"
10-
id="test1"
1111
runOnChange="true"
1212
runAlways="true"
13+
context="foo"
1314
>
14-
<sql>select 1 from sys.dual;</sql>
15+
<sql endDelimiter="/">
16+
begin
17+
raise_application_error(-20001, 'SHOULD NOT HAVE RUN');
18+
end;
19+
/
20+
</sql>
1521
</changeSet>
1622

17-
<!-- Identical changeset identifier needed to test defaults file -->
1823
<changeSet
24+
id="test_2"
1925
author="jlyle"
20-
id="test1"
2126
runOnChange="true"
2227
runAlways="true"
28+
context="runme"
2329
>
24-
<sql>select 1 from sys.dual;</sql>
30+
<output>Should run</output>
2531
</changeSet>
2632
</databaseChangeLog>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
liquibase.allowDuplicatedChangesetIdentifiers=true
1+
liquibase.command.contexts=runme

0 commit comments

Comments
 (0)