diff --git a/app/db/migrations/20240627230956_create_episodes_table.php b/app/db/migrations/20240627230956_create_episodes_table.php new file mode 100644 index 0000000..728ed3f --- /dev/null +++ b/app/db/migrations/20240627230956_create_episodes_table.php @@ -0,0 +1,60 @@ +table('episodes')->addTimestamps(); + + $table->addColumn('title', 'string', [ 'null' => false ]) + ->addColumn('link', 'string') + ->addColumn('duration', 'string') + ->addColumn('length', 'integer') + ->addColumn('description', 'text') + ->addColumn('explicit', 'boolean', [ 'default' => false ]) + ->addColumn('channel_id', 'integer') + ->addColumn('image_id', 'integer', [ 'null' => true ]) + ->addForeignKey('channel_id', 'channels') + ->addForeignKey('image_id', 'images'); + + $table->create(); + } +} diff --git a/app/db/migrations/20240627231445_create_transactions_table.php b/app/db/migrations/20240627231445_create_transactions_table.php new file mode 100644 index 0000000..a8cd3eb --- /dev/null +++ b/app/db/migrations/20240627231445_create_transactions_table.php @@ -0,0 +1,49 @@ +table('transactions')->addTimestamps(); + + $table->addColumn('user_id', 'integer', [ 'null' => false ]) + ->addColumn('code', 'string') + ->addColumn('type', 'string') + ->addColumn('total', 'int', [ 'null' => false ]) + ->addForeignKey('user_id', 'user'); + + $table->create(); + } +} diff --git a/app/db/migrations/20240627231953_create_categories_table.php b/app/db/migrations/20240627231953_create_categories_table.php new file mode 100644 index 0000000..fc4e932 --- /dev/null +++ b/app/db/migrations/20240627231953_create_categories_table.php @@ -0,0 +1,42 @@ +table('categories')->addTimestamps(); + + $table->addColumn('name', 'string', [ 'null' => false ]) + ->addIndex('name', [ 'unique' => true ]); + + $table->create(); + } +}