A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
38
CREATE TABLE account (39
id SERIAL PRIMARY KEY,40
name TEXT,41
language TEXT DEFAULT 'en'41
language TEXT DEFAULT 'en',42
created_at TIMESTAMP WITH TIME ZONE DEFAULT now()43
);45
/* ### device ### */
48
id SERIAL PRIMARY KEY,49
uid TEXT UNIQUE NOT NULL,50
name TEXT,50
account_id INTEGER51
account_id INTEGER,52
created_at TIMESTAMP WITH TIME ZONE DEFAULT now()53
);55
ALTER TABLE device
79
id SERIAL PRIMARY KEY,80
account_id INTEGER,81
station_id INTEGER,80
playtime INTEGER DEFAULT 082
playtime INTEGER DEFAULT 0,83
latest_at TIMESTAMP WITH TIME ZONE DEFAULT now()84
);86
ALTER TABLE station_stats
114
({account_id}, {station_id}, 1)115
ON CONFLICT (account_id, station_id)116
DO UPDATE117
SET playtime = station_stats.playtime + EXCLUDED.playtime;117
SET playtime = station_stats.playtime + EXCLUDED.playtime,118
latest_at = now();119
"#,120
account_id = account.id,121
station_id = station.id,