Overview
Comment:refactor(music/music.sql): add constraint NOT NULL to all columns
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8b148264155399bcfa6438eec0d885d26949a72528a5c2f140350106fea3efd1
User & Date: dbohdan on 2020-08-24 11:08:38
Other Links: manifest | tags
Context
2020-08-24
11:10
style(music/music.sql): capitalize "CREATE INDEX" check-in: d64f34be42 user: dbohdan tags: trunk
11:08
refactor(music/music.sql): add constraint NOT NULL to all columns check-in: 8b14826415 user: dbohdan tags: trunk
10:32
style(skin/js/toc.js): rename parameter "skipRootInSlug" "skipH1sInSlug" check-in: 0d626b8241 user: dbohdan tags: trunk
Changes

Modified music/music.sql from [f3e4adc9a7] to [de79ffb82c].

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
CREATE TABLE categories(
    category_id INTEGER PRIMARY KEY,
    name TEXT
);

CREATE TABLE songs(
    song_id INTEGER PRIMARY KEY,
    artist TEXT NOT NULL,
    title TEXT NOT NULL,
    url TEXT NOT NULL,
    category_id INTEGER,
    FOREIGN KEY(category_id) REFERENCES categories(category_id)
);

create index idx_songs_artist
on songs (artist);

CREATE TABLE notes(
    song_id INTEGER PRIMARY KEY,
    content TEXT,
    FOREIGN KEY(song_id) REFERENCES songs(song_id)
);

CREATE TABLE tags(
    song_id INTEGER,
    tag TEXT,
    PRIMARY KEY (song_id, tag),
    FOREIGN KEY(song_id) REFERENCES songs(song_id)
);


INSERT INTO categories(category_id, name)
VALUES

|
|



|



|







|
|




|
|







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
CREATE TABLE categories(
    category_id INTEGER PRIMARY KEY NOT NULL,
    name TEXT NOT NULL
);

CREATE TABLE songs(
    song_id INTEGER PRIMARY KEY NOT NULL,
    artist TEXT NOT NULL,
    title TEXT NOT NULL,
    url TEXT NOT NULL,
    category_id INTEGER NOT NULL,
    FOREIGN KEY(category_id) REFERENCES categories(category_id)
);

create index idx_songs_artist
on songs (artist);

CREATE TABLE notes(
    song_id INTEGER PRIMARY KEY NOT NULL,
    content TEXT NOT NULL,
    FOREIGN KEY(song_id) REFERENCES songs(song_id)
);

CREATE TABLE tags(
    song_id INTEGER NOT NULL,
    tag TEXT NOT NULL,
    PRIMARY KEY (song_id, tag),
    FOREIGN KEY(song_id) REFERENCES songs(song_id)
);


INSERT INTO categories(category_id, name)
VALUES