diff options
Diffstat (limited to 'migrations/20240101000100_create_locations.sql')
| -rw-r--r-- | migrations/20240101000100_create_locations.sql | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/migrations/20240101000100_create_locations.sql b/migrations/20240101000100_create_locations.sql new file mode 100644 index 0000000..501fb10 --- /dev/null +++ b/migrations/20240101000100_create_locations.sql @@ -0,0 +1,9 @@ +-- Migration: Create locations table +CREATE TABLE IF NOT EXISTS locations ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + latitude REAL NOT NULL, + longitude REAL NOT NULL, + user_id INTEGER NOT NULL, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE NO ACTION +); +CREATE INDEX IF NOT EXISTS idx_locations_user_id ON locations(user_id);
\ No newline at end of file |
