Skip to content

Commit 78800a9

Browse files
committed
improve sql idempotency for ci
Signed-off-by: Mark Nelson <mark.x.nelson@oracle.com>
1 parent bea45cf commit 78800a9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • database/starters/oracle-spring-boot-starter-samples/oracle-spring-boot-sample-spatial/src/test/resources

database/starters/oracle-spring-boot-starter-samples/oracle-spring-boot-sample-spatial/src/test/resources/init.sql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
create table landmarks (
1+
create table if not exists landmarks (
22
id number primary key,
33
name varchar2(200) not null,
44
category varchar2(100) not null,
55
geometry mdsys.sdo_geometry not null
66
);
77

8+
delete from user_sdo_geom_metadata
9+
where table_name = 'LANDMARKS'
10+
and column_name = 'GEOMETRY';
11+
812
insert into user_sdo_geom_metadata (table_name, column_name, diminfo, srid)
913
values (
1014
'LANDMARKS',
@@ -16,10 +20,12 @@ values (
1620
4326
1721
);
1822

19-
create index landmarks_spatial_idx
23+
create index if not exists landmarks_spatial_idx
2024
on landmarks (geometry)
2125
indextype is mdsys.spatial_index_v2;
2226

27+
delete from landmarks;
28+
2329
insert into landmarks (id, name, category, geometry)
2430
values (1, 'Ferry Building', 'MARKET', sdo_util.from_geojson('{"type":"Point","coordinates":[-122.3933,37.7955]}', null, 4326));
2531

0 commit comments

Comments
 (0)