Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sql

  • Loading branch information...
commit 479803589e377982ffff5bba534e162554c0c6c4 1 parent 61058e2
Ivar Abrahamsen authored
Showing with 9 additions and 21 deletions.
  1. +0 −18 conf/evolutions/default/1.sql
  2. +9 −3 conf/evolutions/default/6.sql
View
18 conf/evolutions/default/1.sql
@@ -2,9 +2,6 @@
# --- !Ups
--- SET REFERENTIAL_INTEGRITY FALSE;
-
-DROP TABLE IF EXISTS eventrequest;
DROP TABLE IF EXISTS eventparticipant;
@@ -20,7 +17,6 @@ DROP SEQUENCE IF EXISTS snapalbum_seq;
DROP SEQUENCE IF EXISTS participant_seq;
--- SET REFERENTIAL_INTEGRITY TRUE;
CREATE TABLE snapevent (
eventid SERIAL PRIMARY KEY,
@@ -55,14 +51,6 @@ CREATE TABLE eventparticipant (
foreign key(participantid) references participant(participantid) on delete cascade
);
-CREATE TABLE eventrequests (
- eventid BIGINT NOT NULL,
- participantid BIGINT NOT NULL,
- requestdate TIMESTAMP,
- foreign key(eventid) references snapevent(eventid) on delete cascade,
- foreign key(participantid) references participant(participantid) on delete cascade
-);
-
CREATE SEQUENCE snapevent_seq START WITH 1000;
@@ -76,10 +64,6 @@ CREATE SEQUENCE participant_seq START WITH 1000;
# --- !Downs
---SET REFERENTIAL_INTEGRITY FALSE;
-
-DROP TABLE IF EXISTS eventrequest;
-
DROP TABLE IF EXISTS eventparticipant;
DROP TABLE IF EXISTS participant;
@@ -94,6 +78,4 @@ DROP SEQUENCE IF EXISTS snapalbum_seq;
DROP SEQUENCE IF EXISTS participant_seq;
---SET REFERENTIAL_INTEGRITY TRUE;
-
View
12 conf/evolutions/default/6.sql
@@ -2,9 +2,15 @@
# --- !Ups
+DROP TABLE IF EXISTS eventrequest;
-DELETE FROM eventrequests;
-
+CREATE TABLE eventrequests (
+ eventid BIGINT NOT NULL,
+ participantid BIGINT NOT NULL,
+ requestdate TIMESTAMP,
+ foreign key(eventid) references snapevent(eventid) on delete cascade,
+ foreign key(participantid) references participant(participantid) on delete cascade
+);
INSERT INTO eventrequests (eventid,participantid,requestdate) VALUES (
(SELECT MAX(eventid) FROM snapevent WHERE eventname = 'Adams at Barbados'),
@@ -17,4 +23,4 @@ INSERT INTO eventrequests (eventid,participantid,requestdate) VALUES (
# --- !Downs
-DELETE FROM eventrequests;
+DROP TABLE IF EXISTS eventrequest;
Please sign in to comment.
Something went wrong with that request. Please try again.