diff --git a/app/db/migrations/20240624020713_create_users_table.php b/app/db/migrations/20240624020713_create_users_table.php new file mode 100644 index 0000000..ecb3670 --- /dev/null +++ b/app/db/migrations/20240624020713_create_users_table.php @@ -0,0 +1,44 @@ +table("users"); + $table->addColumn('email', 'string') + ->addColumn('name', 'string') + ->addColumn('password', 'string') + ->addIndex([ 'email' ], [ 'unique' => true ]) + ->create(); + } +} diff --git a/app/db/migrations/20240624022427_create_images.php b/app/db/migrations/20240624022427_create_images.php new file mode 100644 index 0000000..824d951 --- /dev/null +++ b/app/db/migrations/20240624022427_create_images.php @@ -0,0 +1,49 @@ +table('images')->addTimestamps(); + $table->addColumn('url', 'string') + ->addColumn('title', [ 'null' => false ]) + ->addColumn('width', 'integer', [ + 'unsigned' => true, + 'null' => true, + ]) + ->addColumn('height', 'integer', [ + 'unsigned' => true, + 'null' => true + ]) + ->addIndex([ 'url' ], [ 'type' => 'unique' ]) + ->create(); + } +}