Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 99 lines (97 sloc) 3.94 kB
bae1dca @alexkay Add DB PRAGMAs
authored
1 PRAGMA user_version=1;
2 PRAGMA journal_mode=WAL;
3
13e32ee @alexkay Add Artist and ReleaseGroup models
authored
4 CREATE TABLE "app_artist" (
5 "id" integer NOT NULL PRIMARY KEY,
6 "mbid" varchar(36) NOT NULL UNIQUE,
7 "name" varchar(512) NOT NULL,
8 "sort_name" varchar(512) NOT NULL,
9 "disambiguation" varchar(512) NOT NULL
10 );
3b047a0 @alexkay Job model
authored
11 CREATE TABLE "app_job" (
12 "id" integer NOT NULL PRIMARY KEY,
529eca9 @alexkay Add all release groups for new artists
authored
13 "user_id" integer REFERENCES "auth_user" ("id"),
3b047a0 @alexkay Job model
authored
14 "type" integer NOT NULL,
15 "data" text NOT NULL
16 );
861ddc0 @alexkay Add the Notification model
authored
17 CREATE TABLE "app_notification" (
18 "id" integer NOT NULL PRIMARY KEY,
19 "user_id" integer NOT NULL REFERENCES "auth_user" ("id"),
20 "release_group_id" integer NOT NULL,
21 UNIQUE ("user_id", "release_group_id")
22 );
13e32ee @alexkay Add Artist and ReleaseGroup models
authored
23 CREATE TABLE "app_releasegroup" (
24 "id" integer NOT NULL PRIMARY KEY,
25 "artist_id" integer NOT NULL REFERENCES "app_artist" ("id"),
26 "mbid" varchar(36) NOT NULL UNIQUE,
27 "name" varchar(512) NOT NULL,
28 "type" varchar(16) NOT NULL,
29 "date" integer NOT NULL,
30 "is_deleted" bool NOT NULL
31 );
97bdbd5 @alexkay Star release groups
authored
32 CREATE TABLE "app_star" (
33 "id" integer NOT NULL PRIMARY KEY,
34 "user_id" integer NOT NULL REFERENCES "auth_user" ("id"),
35 "release_group_id" integer NOT NULL REFERENCES "app_releasegroup" ("id"),
36 UNIQUE ("user_id", "release_group_id")
37 );
0915072 @alexkay Add UserArtist model
authored
38 CREATE TABLE "app_userartist" (
39 "id" integer NOT NULL PRIMARY KEY,
40 "user_id" integer NOT NULL REFERENCES "auth_user" ("id"),
41 "artist_id" integer NOT NULL REFERENCES "app_artist" ("id"),
7c2341c @alexkay Add UserArtists
authored
42 "date" datetime NOT NULL,
0915072 @alexkay Add UserArtist model
authored
43 UNIQUE ("user_id", "artist_id")
44 );
47c91b7 @alexkay Add UserProfile
authored
45 CREATE TABLE "app_userprofile" (
46 "id" integer NOT NULL PRIMARY KEY,
47 "user_id" integer NOT NULL UNIQUE REFERENCES "auth_user" ("id"),
48 "notify" bool NOT NULL,
49 "notify_album" bool NOT NULL,
50 "notify_single" bool NOT NULL,
51 "notify_ep" bool NOT NULL,
52 "notify_live" bool NOT NULL,
53 "notify_compilation" bool NOT NULL,
54 "notify_remix" bool NOT NULL,
55 "notify_other" bool NOT NULL,
56 "email_activated" bool NOT NULL,
57 "activation_code" varchar(16) NOT NULL,
b296691 @alexkay Add UserProfile.legacy_id, tidy
authored
58 "reset_code" varchar(16) NOT NULL,
59 "legacy_id" integer
47c91b7 @alexkay Add UserProfile
authored
60 );
b1876ee @alexkay Add multiple artists
authored
61 CREATE TABLE "app_usersearch" (
62 "id" integer NOT NULL PRIMARY KEY,
63 "user_id" integer NOT NULL REFERENCES "auth_user" ("id"),
64 "search" varchar(512) NOT NULL
65 );
571a9de @alexkay Add DB schema
authored
66 CREATE TABLE "auth_user" (
67 "id" integer NOT NULL PRIMARY KEY,
68 "username" varchar(30) NOT NULL UNIQUE,
69 "first_name" varchar(30) NOT NULL,
70 "last_name" varchar(30) NOT NULL,
b14d6ea @alexkay Sign up / sign in /sign out
authored
71 "email" varchar(75) NOT NULL UNIQUE,
571a9de @alexkay Add DB schema
authored
72 "password" varchar(128) NOT NULL,
73 "is_staff" bool NOT NULL,
74 "is_active" bool NOT NULL,
75 "is_superuser" bool NOT NULL,
76 "last_login" datetime NOT NULL,
77 "date_joined" datetime NOT NULL
78 );
79 CREATE TABLE "django_session" (
80 "session_key" varchar(40) NOT NULL PRIMARY KEY,
81 "session_data" text NOT NULL,
82 "expire_date" datetime NOT NULL
83 );
57ddf35 @alexkay Show added artists
authored
84 CREATE INDEX "app_artist_sort_name" ON "app_artist" ("sort_name");
3b047a0 @alexkay Job model
authored
85 CREATE INDEX "app_job_user_id" ON "app_job" ("user_id");
861ddc0 @alexkay Add the Notification model
authored
86 CREATE INDEX "app_notification_user_id" ON "app_notification" ("user_id");
87 CREATE INDEX "app_notification_release_group_id" ON "app_notification" ("release_group_id");
13e32ee @alexkay Add Artist and ReleaseGroup models
authored
88 CREATE INDEX "app_releasegroup_artist_id" ON "app_releasegroup" ("artist_id");
c05a3b0 @alexkay Calendar
authored
89 CREATE INDEX "app_releasegroup_date" ON "app_releasegroup" ("date" DESC);
778944b @alexkay Initialise and sort by is_starred
authored
90 CREATE INDEX "app_star_user_id" ON "app_star" ("user_id");
91 CREATE INDEX "app_star_release_group_id" ON "app_star" ("release_group_id");
be118e8 @alexkay Make UserArtist a ManyToManyField
authored
92 CREATE INDEX "app_userartist_user_id" ON "app_userartist" ("user_id");
93 CREATE INDEX "app_userartist_artist_id" ON "app_userartist" ("artist_id");
b296691 @alexkay Add UserProfile.legacy_id, tidy
authored
94 CREATE INDEX "app_userprofile_activation_code" ON "app_userprofile" ("activation_code");
95 CREATE INDEX "app_userprofile_reset_code" ON "app_userprofile" ("reset_code");
96 CREATE INDEX "app_userprofile_legacy_id" ON "app_userprofile" ("legacy_id");
b1876ee @alexkay Add multiple artists
authored
97 CREATE INDEX "app_usersearch_user_id" ON "app_usersearch" ("user_id");
bae1dca @alexkay Add DB PRAGMAs
authored
98 CREATE INDEX "django_session_expire_date" ON "django_session" ("expire_date");
Something went wrong with that request. Please try again.