WIP on add/edit feed page (#4)

This commit is contained in:
2024-04-06 11:02:48 -04:00
parent 74bc83f266
commit 7d30454d90
6 changed files with 94 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ class Data {
$tableQuery = $db->query("SELECT name FROM sqlite_master WHERE type = 'table'");
while ($table = $tableQuery->fetchArray(SQLITE3_NUM)) $tables[] = $table[0];
if (!in_array('frc_user', $tables)) {
$query = <<<SQL
$query = <<<'SQL'
CREATE TABLE frc_user (
id INTEGER NOT NULL PRIMARY KEY,
email TEXT NOT NULL,
@@ -33,18 +33,20 @@ class Data {
$db->exec('CREATE INDEX idx_user_email ON frc_user (email)');
}
if (!in_array('feed', $tables)) {
$query = <<<SQL
$query = <<<'SQL'
CREATE TABLE feed (
id INTEGER NOT NULL PRIMARY KEY,
user_id INTEGER NOT NULL,
url TEXT NOT NULL,
title TEXT,
updated_on TEXT,
checked_on TEXT,
FOREIGN KEY (user_id) REFERENCES frc_user (id))
SQL;
$db->exec($query);
}
if (!in_array('item', $tables)) {
$query = <<<SQL
$query = <<<'SQL'
CREATE TABLE item (
id INTEGER NOT NULL PRIMARY KEY,
feed_id INTEGER NOT NULL,