toll pricing table structure#
Field |
Type |
NULL allowed |
Default Value |
Foreign key |
Description |
---|---|---|---|---|---|
link |
INTEGER |
NO |
Link(link) |
||
dir |
INTEGER |
NO |
0 |
||
start_time |
INTEGER |
NO |
0 |
||
end_time |
INTEGER |
NO |
0 |
||
price |
REAL |
NO |
0 |
(* - Primary key)
The SQL statement for table and index creation is below.
CREATE TABLE IF NOT EXISTS "Toll_Pricing" (
"link" INTEGER NOT NULL,
"dir" INTEGER NOT NULL DEFAULT 0,
"start_time" INTEGER NOT NULL DEFAULT 0,
"end_time" INTEGER NOT NULL DEFAULT 0,
"price" REAL NOT NULL DEFAULT 0,
CONSTRAINT "link_fk" FOREIGN KEY("link") REFERENCES "Link"("link") DEFERRABLE INITIALLY DEFERRED -- check
CHECK("dir" >= 0),
CHECK("dir" >= 0),
CHECK("price" >= 0),
CHECK(TYPEOF("dir") == 'integer')
);