diff --git a/php/src/app/Models/Album.php b/php/src/app/Models/Album.php new file mode 100644 index 0000000..e009242 --- /dev/null +++ b/php/src/app/Models/Album.php @@ -0,0 +1,11 @@ +id(); + $table->timestamps(); + $table->string('name'); + $table->string('image')->nullable(); + $table->string('url_remote')->nullable(); + $table->string('url_local')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('artists'); + } +}; diff --git a/php/src/database/migrations/2024_08_05_011726_create_albums_table.php b/php/src/database/migrations/2024_08_05_011726_create_albums_table.php new file mode 100644 index 0000000..e13c029 --- /dev/null +++ b/php/src/database/migrations/2024_08_05_011726_create_albums_table.php @@ -0,0 +1,38 @@ +id(); + $table->timestamps(); + $table->string('name'); + $table->string('image')->nullable(); + $table->foreignId('artist_id')->constrained(Artist::class); + $table->string('url_remote')->nullable(); + $table->string('url_local')->nullable(); + $table->enum('state', [ + 'pending', + 'in_progress', + 'done', + ])->default('pending'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('albums'); + } +}; diff --git a/php/src/database/migrations/2024_08_05_011735_create_songs_table.php b/php/src/database/migrations/2024_08_05_011735_create_songs_table.php new file mode 100644 index 0000000..c6860dc --- /dev/null +++ b/php/src/database/migrations/2024_08_05_011735_create_songs_table.php @@ -0,0 +1,37 @@ +id(); + $table->timestamps(); + $table->string('name'); + $table->foreignId('album_id')->constrained(Album::class); + $table->string('url_remote')->nullable(); + $table->string('url_local')->nullable(); + $table->enum('state', [ + 'pending', + 'in_progress', + 'done', + ])->default('pending'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('songs'); + } +};