· 8 years ago · Aug 09, 2018, 11:00 PM
1
2drop table if exists users;
3create table users (
4 id integer primary key autoincrement,
5 userlvel_id integer not null,
6 alias string not null,
7 pwd string not null,
8 email strong not null,
9 date_joined timestamp not null,
10 last_login timestamp not null,
11 notes string
12);
13
14drop table if exists userlevels;
15create table userlevels (
16 id integer primary key autoincrement,
17 text string not null,
18 time_stamp timestamp not null,
19 notes string
20);
21
22drop table if exists artists;
23create table artists (
24 id integer primary key autoincrement,
25 user_id integer not null,
26 country string not null,
27 time_stamp timestamp not null,
28 notes string
29);
30
31drop table if exists songs;
32create table songs (
33 id integer primary key autoincrement,
34 artist_id integer not null,
35 user_id integer not null,
36 title string not null,
37 time_stamp timestamp,
38 notes string
39);
40
41drop table if exists tabs;
42create table tabs (
43 id integer primary key autoincrement,
44 song_id integer not null,
45 user_id integer not null,
46 text string not null,
47 time_stamp timestamp not null,
48 notes string
49);
50
51drop table if exists votes;
52create table comments (
53 id integer primary key autoincrement,
54 page_id integer not null, -- tab / request / comments
55 record_id integer not null, -- requests record id on the page id
56 user_id integer not null,
57 text string not null,
58 time_stamp timestamp not null,
59 notes string
60);
61
62drop table exists requests;
63create table requests (
64 id integer primary key autoincrement,
65 song_id integer not null,
66 time_stamp timestamp not null,
67 notes string
68);
69
70drop table exists votes;
71create table votes (
72 id integer primary key autoincrement,
73 page_id integer not null,
74 record_id integer not null,
75 user_id integer not null,
76 val integer not null,
77 time_stamp timestamp not null,
78 notes string
79);