You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
<?php
|
|
|
|
namespace Fuel\Migrations;
|
|
|
|
class Create_library
|
|
{
|
|
public function up()
|
|
{
|
|
\DBUtil::create_table('library', array(
|
|
'id' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
|
|
'server_id' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
|
|
'plex_key' => array('type' => 'int', 'null' => false, 'constraint' => 11),
|
|
'name' => array('type' => 'varchar', 'null' => false, 'constraint' => 255),
|
|
'type' => array('type' => 'varchar', 'null' => false, 'constraint' => 255),
|
|
'updatedAt' => array('type' => 'int', 'null' => false, 'constraint' => 11),
|
|
'createdAt' => array('type' => 'int', 'null' => false, 'constraint' => 11),
|
|
'scannedAt' => array('type' => 'int', 'null' => false, 'constraint' => 11),
|
|
'disable' => array('default' => '0', 'type' => 'int', 'null' => false, 'constraint' => 1),
|
|
), array('id'));
|
|
|
|
\DB::query('CREATE INDEX constraintServerLibrary ON ' . \DB::table_prefix('library') . '(`server_id`)')->execute();
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
\DB::query('DROP INDEX constraintServerLibrary ON ' . \DB::table_prefix('library'))->execute();
|
|
|
|
\DBUtil::drop_table('library');
|
|
}
|
|
} |