-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #522 from leepeuker/add-external-links-to-person
Add external provider links always to movie and person detail pages
- Loading branch information
Showing
12 changed files
with
241 additions
and
22 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
db/migrations/mysql/20231001110211_AddImdbIdToPersonTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php declare(strict_types=1); | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
final class AddImdbIdToPersonTable extends AbstractMigration | ||
{ | ||
public function down() : void | ||
{ | ||
$this->execute( | ||
<<<SQL | ||
ALTER TABLE person DROP COLUMN imdb_id; | ||
SQL, | ||
); | ||
} | ||
|
||
public function up() : void | ||
{ | ||
$this->execute( | ||
<<<SQL | ||
ALTER TABLE person ADD COLUMN imdb_id VARCHAR(10) DEFAULT NULL AFTER tmdb_id; | ||
SQL, | ||
); | ||
} | ||
} |
129 changes: 129 additions & 0 deletions
129
db/migrations/sqlite/20231001110211_AddImdbIdToPersonTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<?php declare(strict_types=1); | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
final class AddImdbIdToPersonTable extends AbstractMigration | ||
{ | ||
public function down() | ||
{ | ||
$this->execute( | ||
<<<SQL | ||
CREATE TABLE `tmp_person` ( | ||
`id` INTEGER, | ||
`name` TEXT NOT NULL, | ||
`gender` TEXT NOT NULL, | ||
`known_for_department` TEXT DEFAULT NULL, | ||
`poster_path` TEXT DEFAULT NULL, | ||
`biography` TEXT DEFAULT NULL, | ||
`birth_date` TEXT DEFAULT NULL, | ||
`place_of_birth` TEXT DEFAULT NULL, | ||
`death_date` TEXT DEFAULT NULL, | ||
`tmdb_id` INTEGER NOT NULL, | ||
`tmdb_poster_path` TEXT DEFAULT NULL, | ||
`created_at` TEXT NOT NULL, | ||
`updated_at` TEXT DEFAULT NULL, | ||
`updated_at_tmdb` TEXT DEFAULT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE (`tmdb_id`) | ||
) | ||
SQL, | ||
); | ||
$this->execute( | ||
'INSERT INTO `tmp_person` ( | ||
`id`, | ||
`name`, | ||
`gender`, | ||
`known_for_department`, | ||
`poster_path`, | ||
`biography`, | ||
`birth_date`, | ||
`place_of_birth`, | ||
`death_date`, | ||
`tmdb_id`, | ||
`tmdb_poster_path`, | ||
`created_at`, | ||
`updated_at`, | ||
`updated_at_tmdb` | ||
) SELECT | ||
`id`, | ||
`name`, | ||
`gender`, | ||
`known_for_department`, | ||
`poster_path`, | ||
`biography`, | ||
`birth_date`, | ||
`place_of_birth`, | ||
`death_date`, | ||
`tmdb_id`, | ||
`tmdb_poster_path`, | ||
`created_at`, | ||
`updated_at`, | ||
`updated_at_tmdb` | ||
FROM `person`', | ||
); | ||
$this->execute('DROP TABLE `person`'); | ||
$this->execute('ALTER TABLE `tmp_person` RENAME TO `person`'); | ||
} | ||
|
||
public function up() | ||
{ | ||
$this->execute( | ||
<<<SQL | ||
CREATE TABLE `tmp_person` ( | ||
`id` INTEGER, | ||
`name` TEXT NOT NULL, | ||
`gender` TEXT NOT NULL, | ||
`known_for_department` TEXT DEFAULT NULL, | ||
`poster_path` TEXT DEFAULT NULL, | ||
`biography` TEXT DEFAULT NULL, | ||
`birth_date` TEXT DEFAULT NULL, | ||
`place_of_birth` TEXT DEFAULT NULL, | ||
`death_date` TEXT DEFAULT NULL, | ||
`tmdb_id` INTEGER NOT NULL, | ||
`imdb_id` TEXT DEFAULT NULL, | ||
`tmdb_poster_path` TEXT DEFAULT NULL, | ||
`created_at` TEXT NOT NULL, | ||
`updated_at` TEXT DEFAULT NULL, | ||
`updated_at_tmdb` TEXT DEFAULT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE (`tmdb_id`) | ||
) | ||
SQL, | ||
); | ||
$this->execute( | ||
'INSERT INTO `tmp_person` ( | ||
`id`, | ||
`name`, | ||
`gender`, | ||
`known_for_department`, | ||
`poster_path`, | ||
`biography`, | ||
`birth_date`, | ||
`place_of_birth`, | ||
`death_date`, | ||
`tmdb_id`, | ||
`tmdb_poster_path`, | ||
`created_at`, | ||
`updated_at`, | ||
`updated_at_tmdb` | ||
) SELECT | ||
`id`, | ||
`name`, | ||
`gender`, | ||
`known_for_department`, | ||
`poster_path`, | ||
`biography`, | ||
`birth_date`, | ||
`place_of_birth`, | ||
`death_date`, | ||
`tmdb_id`, | ||
`tmdb_poster_path`, | ||
`created_at`, | ||
`updated_at`, | ||
`updated_at_tmdb` | ||
FROM `person`', | ||
); | ||
$this->execute('DROP TABLE `person`'); | ||
$this->execute('ALTER TABLE `tmp_person` RENAME TO `person`'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.