SQL
CREATE TABLE phone_institution_map (
id INTEGER PRIMARY KEY AUTOINCREMENT,
phone TEXT NOT NULL,
institution_id TEXT NOT NULL,
role TEXT DEFAULT 'student' CHECK(role IN ('student','parent','teacher','admin')),
note TEXT,
created_at DATETIME DEFAULT (datetime('now')),
UNIQUE(phone, institution_id)
)
+ Add column
Columns
+ Add index
Indexes
| Name |
Columns |
Unique |
SQL |
Drop? |
| idx_phone_map_inst |
institution_id
|
|
SQL
CREATE INDEX idx_phone_map_inst
ON phone_institution_map(institution_id)
|
Drop
|
| idx_phone_map_phone |
phone
|
|
SQL
CREATE INDEX idx_phone_map_phone
ON phone_institution_map(phone)
|
Drop
|
| sqlite_autoindex_phone_institution_map_1 |
|
✓ |
SQL
-- no sql found --
|
Drop
|