File: create_table_deferrable.sql

package info (click to toggle)
sqlfluff 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,000 kB
  • sloc: python: 106,131; sql: 34,188; makefile: 52; sh: 8
file content (73 lines) | stat: -rw-r--r-- 1,780 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
-- check deferrable in table constrain segment
CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) DEFERRABLE
);

CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED
);

CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) DEFERRABLE INITIALLY IMMEDIATE
);

CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) NOT DEFERRABLE
);

CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) NOT DEFERRABLE INITIALLY DEFERRED
);

CREATE TABLE messages(
    msg_id TEXT,
    parent_id TEXT,
    FOREIGN KEY(parent_id) REFERENCES users(id) NOT DEFERRABLE INITIALLY IMMEDIATE
);

-- check deferrable in column constrain segment
CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) DEFERRABLE
);

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) DEFERRABLE INITIALLY DEFERRED
);

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) DEFERRABLE INITIALLY IMMEDIATE
);

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) NOT DEFERRABLE
);

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) NOT DEFERRABLE INITIALLY DEFERRED
);

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER REFERENCES artist(artistid) NOT DEFERRABLE INITIALLY IMMEDIATE
);