diff --git a/src/app/Models/Card.php b/src/app/Models/Card.php new file mode 100644 index 0000000..19e23ca --- /dev/null +++ b/src/app/Models/Card.php @@ -0,0 +1,11 @@ +id(); + $table->string('name'); + $table->integer('card_count'); + $table->string('cover_path'); + $table->string('backside_path'); + $table->string('type')->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('decks'); + } +}; diff --git a/src/database/migrations/2023_07_08_152018_create_tags_table.php b/src/database/migrations/2023_07_08_152018_create_tags_table.php new file mode 100644 index 0000000..85f6a52 --- /dev/null +++ b/src/database/migrations/2023_07_08_152018_create_tags_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tags'); + } +}; diff --git a/src/database/migrations/2023_07_08_152030_create_cards_table.php b/src/database/migrations/2023_07_08_152030_create_cards_table.php new file mode 100644 index 0000000..06eba07 --- /dev/null +++ b/src/database/migrations/2023_07_08_152030_create_cards_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('cards'); + } +}; diff --git a/src/database/migrations/2023_07_08_161526_create_decks_tags_table.php b/src/database/migrations/2023_07_08_161526_create_decks_tags_table.php new file mode 100644 index 0000000..0cb73b4 --- /dev/null +++ b/src/database/migrations/2023_07_08_161526_create_decks_tags_table.php @@ -0,0 +1,33 @@ +id(); + $table->unsignedBiginteger('decks_id')->unsigned(); + $table->unsignedBiginteger('tags_id')->unsigned(); + + $table->foreign('decks_id')->references('id')->on('decks')->onDelete('cascade'); + $table->foreign('tags_id')->references('id')->on('tags')->onDelete('cascade'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('decks_tags'); + } +};