@@ -16,7 +16,7 @@ function getDbConnection() {
|
||||
}
|
||||
|
||||
function migrate($db) {
|
||||
$db->exec("CREATE TABLE IF NOT EXISTS documents (
|
||||
try { $db->exec("CREATE TABLE IF NOT EXISTS documents (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
doc_type VARCHAR(50) NOT NULL,
|
||||
team_id INT NOT NULL,
|
||||
@@ -24,9 +24,9 @@ function migrate($db) {
|
||||
content TEXT,
|
||||
occurred_at DATETIME NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (team_id) REFERENCES teams(id) ON DELETE CASCADE
|
||||
)");
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
)"); } catch (Exception $e) {}
|
||||
try { $db->exec("ALTER TABLE documents ADD COLUMN IF NOT EXISTS updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER created_at"); } catch (Exception $e) {}
|
||||
$db->exec("CREATE TABLE IF NOT EXISTS network_shapes (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
label VARCHAR(255) NOT NULL DEFAULT '',
|
||||
|
||||
Reference in New Issue
Block a user