summaryrefslogtreecommitdiff
path: root/migrations/20240101000100_create_locations.sql
blob: 501fb10d08e4ec2cf2727f4b11858ea4a43b0538 (plain)
1
2
3
4
5
6
7
8
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);