Deploy from Lumerel
This commit is contained in:
13
migrations/001_create_watchlist_table.php
Normal file
13
migrations/001_create_watchlist_table.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS watchlist (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
type ENUM('movie', 'show') NOT NULL DEFAULT 'movie',
|
||||
streaming_service VARCHAR(100) DEFAULT NULL,
|
||||
genre VARCHAR(100) DEFAULT NULL,
|
||||
notes TEXT DEFAULT NULL,
|
||||
watched TINYINT(1) NOT NULL DEFAULT 0,
|
||||
watched_at TIMESTAMP NULL DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
)");
|
||||
5
migrations/002_add_for_whom_to_watchlist.php
Normal file
5
migrations/002_add_for_whom_to_watchlist.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$cols = $pdo->query("SHOW COLUMNS FROM watchlist LIKE 'for_whom'")->fetchAll();
|
||||
if (empty($cols)) {
|
||||
$pdo->exec("ALTER TABLE watchlist ADD COLUMN for_whom ENUM('all', 'nik', 'tod') NOT NULL DEFAULT 'all' AFTER type");
|
||||
}
|
||||
Reference in New Issue
Block a user