tests and laravel models
This commit is contained in:
@@ -13,12 +13,14 @@ class CreateParseabcTables extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('collections', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name', 255)->unique();
|
||||
$table->binary('id');
|
||||
$table->string('name', 255)->nullable();
|
||||
$table->string('L', 5)->nullable();
|
||||
$table->string('meter', 3)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
Schema::create('collection_attributes', function (Blueprint $table) {
|
||||
$table->bigInteger('collection_id')->unsigned();
|
||||
$table->binary('collection_id');
|
||||
$table->enum('type', ['Author','Composer','Discography','Rhythm','History','File','Book','Note','Source','Transcriber']);
|
||||
$table->string('string', 255);
|
||||
$table->tinyInteger('ordering')->unsigned()->default(0);
|
||||
@@ -36,22 +38,22 @@ class CreateParseabcTables extends Migration
|
||||
// });
|
||||
|
||||
Schema::create('persons', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->binary('id');
|
||||
$table->string('name', 63);
|
||||
$table->string('email', 255);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('tunes', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->binary('id');
|
||||
$table->tinyInteger('x_id')->default('1');
|
||||
$table->timestamps();
|
||||
|
||||
});
|
||||
|
||||
Schema::create('tune_settings', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('tune_id')->unsigned();
|
||||
$table->binary('id');
|
||||
$table->binary('tune_id');
|
||||
$table->string('meter', 3)->default('C');
|
||||
$table->string('keysig',5)->default('C');
|
||||
$table->string('filename', 255)->nullable();
|
||||
@@ -63,7 +65,7 @@ class CreateParseabcTables extends Migration
|
||||
$table->foreign('tune_id')->references('id')->on('tunes')->onUpdate('cascade')->onDelete('cascade');
|
||||
});
|
||||
Schema::create('tune_attributes', function (Blueprint $table) {
|
||||
$table->bigInteger('tune_id')->unsigned();
|
||||
$table->binary('tune_id');
|
||||
$table->enum('type', ['Title','Group','Origin','Rhythm','History']);
|
||||
$table->string('string', 255);
|
||||
$table->tinyInteger('ordering')->unsigned()->default(0);
|
||||
@@ -73,8 +75,8 @@ class CreateParseabcTables extends Migration
|
||||
});
|
||||
|
||||
Schema::create('tune_books', function (Blueprint $table) {
|
||||
$table->bigInteger('collection_id')->unsigned();
|
||||
$table->bigInteger('setting_id')->unsigned();
|
||||
$table->binary('collection_id');
|
||||
$table->binary('setting_id');
|
||||
$table->timestamps();
|
||||
$table->primary(['collection_id','setting_id']);
|
||||
$table->foreign('collection_id')->references('id')->on('collections')->onUpdate('cascade')->onDelete('cascade');
|
||||
@@ -82,8 +84,8 @@ class CreateParseabcTables extends Migration
|
||||
});
|
||||
|
||||
Schema::create('tune_persons', function (Blueprint $table) {
|
||||
$table->bigInteger('tune_id')->unsigned();
|
||||
$table->bigInteger('person_id')->unsigned();
|
||||
$table->binary('tune_id');
|
||||
$table->binary('person_id');
|
||||
$table->enum('type', ['Author','Composer','Transcriber','']);
|
||||
$table->tinyInteger('ordering')->unsigned()->default(0);
|
||||
$table->timestamps();
|
||||
@@ -93,7 +95,7 @@ class CreateParseabcTables extends Migration
|
||||
});
|
||||
|
||||
Schema::create('tune_setting_attributes', function (Blueprint $table) {
|
||||
$table->bigInteger('setting_id')->unsigned();
|
||||
$table->binary('setting_id');
|
||||
$table->enum('type', ['Transcriber','Note','Discography','Source','Word','Book']);
|
||||
$table->string('string', 255);
|
||||
$table->tinyInteger('ordering')->unsigned()->default(0);
|
||||
@@ -103,8 +105,8 @@ class CreateParseabcTables extends Migration
|
||||
});
|
||||
|
||||
Schema::create('tune_setting_persons', function (Blueprint $table) {
|
||||
$table->bigInteger('setting_id')->unsigned();
|
||||
$table->bigInteger('person_id')->unsigned();
|
||||
$table->binary('setting_id');
|
||||
$table->binary('person_id');
|
||||
$table->tinyInteger('ordering')->unsigned()->default(0);
|
||||
$table->timestamps();
|
||||
$table->primary(['setting_id','person_id','ordering']);
|
||||
|
||||
Reference in New Issue
Block a user