21 lines
484 B
SQL
21 lines
484 B
SQL
CREATE TABLE post (
|
|
id BIGINT PRIMARY KEY NOT NULL,
|
|
description TEXT NOT NULL,
|
|
posted_date DATETIME NOT NULL,
|
|
crawled_date DATETIME NOT NULL
|
|
);
|
|
|
|
CREATE TABLE image (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
post_id BIGINT NOT NULL,
|
|
url TEXT NOT NULL,
|
|
FOREIGN KEY (post_id) REFERENCES post(id)
|
|
);
|
|
|
|
CREATE TABLE video (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
post_id BIGINT NOT NULL,
|
|
url TEXT NOT NULL,
|
|
FOREIGN KEY (post_id) REFERENCES post(id)
|
|
);
|