You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
771 B
SQL
28 lines
771 B
SQL
CREATE TABLE IF NOT EXISTS locations
|
|
(
|
|
id text PRIMARY KEY,
|
|
country text,
|
|
city text,
|
|
region text
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS providers
|
|
(
|
|
id integer PRIMARY KEY AUTOINCREMENT,
|
|
name TEXT NOT NULL UNIQUE
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS prayer_times
|
|
(
|
|
provider_id integer NOT NULL REFERENCES providers (id),
|
|
location_id text NOT NULL REFERENCES locations (id),
|
|
date datetime NOT NULL,
|
|
fajr text NOT NULL,
|
|
sunrise text NOT NULL,
|
|
dhuhr text NOT NULL,
|
|
asr text NOT NULL,
|
|
maghrib text NOT NULL,
|
|
isha text NOT NULL
|
|
);
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS prayer_times__provider__location ON prayer_times (provider_id, location_id, date); |