diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 4a5784f08..8dfce7875 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -25,7 +25,6 @@ class CreateUsersTable extends Migration $table->integer('expires_in')->default(0); $table->string('owner_hash'); $table->string('user_type')->default('Guest'); - $table->string('role')->default('Guest'); $table->text('scopes')->nullable(); $table->string('email')->unique()->nullable(); $table->timestamp('email_verified_at')->nullable(); @@ -33,6 +32,142 @@ class CreateUsersTable extends Migration $table->timestamps(); }); } + + if(!Schema::hasTable('user_roles')) { + Schema::create('user_roles', function (Blueprint $table) { + $table->increments('id'); + $table->integer('character_id')->unsigned(); + $table->foreign('character_id')->references('character_id')->on('users'); + $table->string('role')->default('None'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('EsiTokens')) { + Schema::create('EsiTokens', function(Blueprint $table) { + $table->increments('id'); + $table->integer('character_id')->unique(); + $table->string('access_token'); + $table->string('refresh_token'); + $table->integer('expires_in'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('EsiScopes')) { + Schema::create('EsiScopes', function(Blueprint $table) { + $table->increments('id'); + $table->integer('character_id'); + $table->foreign('character_id')->references('character_id')->on('EsiTokens'); + $table->string('scope'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('user_permissions')) { + Schema::create('user_permissions', function (Blueprint $table) { + $table->increments('id'); + $table->integer('character_id')->unsigned(); + $table->foreign('character_id')->references('character_id')->on('users'); + $table->string('permission'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('available_user_permissions')) { + Schema::create('available_user_permissions', function(Blueprint $table) { + $table->increments('id'); + $table->string('permission'); + }); + } + + if(!Schema::hasTable('available_user_roles')) { + Schema::create('available_user_roles', function (Blueprint $table) { + $table->increments('id'); + $table->string('role'); + $table->string('description'); + $table->timestamps(); + }); + + DB::table('available_user_roles')->insert([ + 'role' => 'None', + 'description' => 'User has no roles and is not allowed in the site.', + ]); + + DB::table('available_user_roles')->insert([ + 'role' => 'Guest', + 'description' => 'Guest of the site.', + ]); + + DB::table('available_user_roles')->insert([ + 'role' => 'Renter', + 'description' => 'Renters of W4RP.', + ]); + + DB::table('available_user_roles')->insert([ + 'role' => 'User', + 'description' => 'Members of Legacy allowed on the site.', + ]); + + DB::table('available_user_roles')->insert([ + 'role' => 'Admin', + 'description' => 'Admin of the site.', + ]); + + DB::table('available_user_roles')->insert([ + 'role' => 'SuperUser', + 'description' => 'Super user of the site.', + ]); + } + + if(!Schema::hasTable('user_to_corporation')) { + Schema::create('user_to_corporation', function (Blueprint $table) { + $table->increments('id'); + $table->string('character_id'); + $table->string('character_name'); + $table->string('corporation_id'); + $table->string('corporation_name'); + }); + } + + if(!Schema::hasTable('AllianceCorps')) { + Schema::create('AllianceCorps', function(Blueprint $table) { + $table->integer('corporation_id')->unique(); + $table->string('name'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('character_to_corporation')) { + Schema::create('character_to_corporation', function (Blueprint $table) { + $table->increments('id'); + $table->string('character_id'); + $table->string('character_name'); + $table->string('corporation_id'); + $table->string('corporation_name'); + }); + } + + if(!Schema::hasTable('corporation_to_alliance')) { + Schema::create('corporation_to_alliance', function (Blueprint $table) { + $table->increments('id'); + $table->string('corporation_id'); + $table->string('corporation_name'); + $table->string('alliance_id'); + $table->string('alliance_name'); + }); + } + + if(!Schema::hasTable('allowed_logins')) { + Schema::create('allowed_logins', function(Blueprint $table) { + $table->increments('id'); + $table->string('entity_id'); + $table->string('entity_type'); + $table->string('entity_name'); + $table->string('login_type'); + $table->timestamps(); + }); + } } /** @@ -43,5 +178,16 @@ class CreateUsersTable extends Migration public function down() { Schema::dropIfExists('users'); + Schema::dropIfExists('available_user_roles'); + Schema::dropIfExists('user_roles'); + Schema::dropIfExists('EsiTokens'); + Schema::dropIfExists('EsiScopes'); + Schema::dropIfExists('available_user_permissions'); + Schema::dropIfExists('user_permissions'); + Schema::dropIfExists('user_to_corporation'); + Schema::dropIfExists('AllianceCorps'); + Schema::dropIfExists('character_to_corporation'); + Schema::dropIfExists('corporation_to_alliance'); + Schema::dropIfExists('allowed_logins'); } } diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php deleted file mode 100644 index 7aeb54f73..000000000 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ /dev/null @@ -1,34 +0,0 @@ -string('email')->index(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('password_resets'); - } -} diff --git a/database/migrations/2018_10_06_220248_create_moons_table.php b/database/migrations/2018_10_06_220248_create_moons_table.php index 548d113b2..56baf621f 100644 --- a/database/migrations/2018_10_06_220248_create_moons_table.php +++ b/database/migrations/2018_10_06_220248_create_moons_table.php @@ -31,6 +31,22 @@ class CreateMoonsTable extends Migration $table->integer('FourthQuantity')->default('0'); $table->string('RentalCorp')->default('Not Rented'); $table->integer('RentalEnd')->default('0'); + $table->string('Paid')->default('No'); + }); + } + + if(!Schema::hasTable('moon_rents')) { + Schema::create('moon_rents', function (Blueprint $table) { + $table->increments('id'); + $table->string('System'); + $table->string('Planet'); + $table->string('Moon'); + $table->string('RentalCorp'); + $table->dateTime('RentalEnd'); + $table->string('Contact'); + $table->string('Price'); + $table->string('Type'); + $table->string('Paid'); }); } } @@ -43,5 +59,6 @@ class CreateMoonsTable extends Migration public function down() { Schema::dropIfExists('Moons'); + Schema::dropIfExists('moon_rents'); } } diff --git a/database/migrations/2018_10_24_032959_create_prices_table.php b/database/migrations/2018_10_24_032959_create_prices_table.php deleted file mode 100644 index ea1e1b355..000000000 --- a/database/migrations/2018_10_24_032959_create_prices_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->text('Name'); - $table->integer('ItemId'); - $table->decimal('Price', 20, 2); - $table->string('Time'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('Prices'); - } -} diff --git a/database/migrations/2018_10_24_033246_create_oreprices_table.php b/database/migrations/2018_10_24_033246_create_oreprices_table.php deleted file mode 100644 index da12b0b31..000000000 --- a/database/migrations/2018_10_24_033246_create_oreprices_table.php +++ /dev/null @@ -1,38 +0,0 @@ -increments('id'); - $table->string('Name'); - $table->integer('ItemId'); - $table->decimal('BatchPrice', 20,2); - $table->decimal('UnitPrice', 20, 2); - $table->decimal('m3Price', 20, 2); - $table->string('Time'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('OrePrices'); - } -} diff --git a/database/migrations/2018_10_24_033452_create_config_table.php b/database/migrations/2018_10_24_033452_create_config_table.php index b550cdbc5..86ccce4c5 100644 --- a/database/migrations/2018_10_24_033452_create_config_table.php +++ b/database/migrations/2018_10_24_033452_create_config_table.php @@ -21,6 +21,72 @@ class CreateConfigTable extends Migration $table->integer('RentalTime'); }); } + + if(!Schema::hasTable('ItemComposition')) { + Schema::create('ItemComposition', function (Blueprint $table) { + $table->string('Name')->unique(); + $table->integer('ItemId'); + $table->decimal('m3Size', 10, 2)->default(0.00); + $table->integer('BatchSize')->default(100); + $table->integer('Tritanium')->default(0); + $table->integer('Pyerite')->default(0); + $table->integer('Mexallon')->default(0); + $table->integer('Isogen')->default(0); + $table->integer('Nocxium')->default(0); + $table->integer('Zydrine')->default(0); + $table->integer('Megacyte')->default(0); + $table->integer('Morphite')->default(0); + $table->integer('HeavyWater')->default(0); + $table->integer('LiquidOzone')->default(0); + $table->integer('NitrogenIsotopes')->default(0); + $table->integer('HeliumIsotopes')->default(0); + $table->integer('HydrogenIsotopes')->default(0); + $table->integer('OxygenIsotopes')->default(0); + $table->integer('StrontiumClathrates')->default(0); + $table->integer('AtmosphericGases')->default(0); + $table->integer('EvaporiteDeposits')->default(0); + $table->integer('Hydrocarbons')->default(0); + $table->integer('Silicates')->default(0); + $table->integer('Cobalt')->default(0); + $table->integer('Scandium')->default(0); + $table->integer('Titanium')->default(0); + $table->integer('Tungsten')->default(0); + $table->integer('Cadmium')->default(0); + $table->integer('Platinum')->default(0); + $table->integer('Vanadium')->default(0); + $table->integer('Chromium')->default(0); + $table->integer('Technetium')->default(0); + $table->integer('Hafnium')->default(0); + $table->integer('Caesium')->default(0); + $table->integer('Mercury')->default(0); + $table->integer('Dysprosium')->default(0); + $table->integer('Neodymium')->default(0); + $table->integer('Promethium')->default(0); + $table->integer('Thulium')->default(0); + }); + } + + if(!Schema::hasTable('Prices')) { + Schema::create('Prices', function (Blueprint $table) { + $table->increments('id'); + $table->text('Name'); + $table->integer('ItemId'); + $table->decimal('Price', 20, 2); + $table->string('Time'); + }); + } + + if(!Schema::hasTable('OrePrices')) { + Schema::create('OrePrices', function (Blueprint $table) { + $table->increments('id'); + $table->string('Name'); + $table->integer('ItemId'); + $table->decimal('BatchPrice', 20,2); + $table->decimal('UnitPrice', 20, 2); + $table->decimal('m3Price', 20, 2); + $table->string('Time'); + }); + } } /** @@ -31,5 +97,8 @@ class CreateConfigTable extends Migration public function down() { Schema::dropIfExists('Config'); + Schema::dropIfExists('ItemComposition'); + Schema::dropIfExists('Prices'); + Schema::dropIfExists('OrePrices'); } } diff --git a/database/migrations/2018_10_26_035551_create_item_composition_table.php b/database/migrations/2018_10_26_035551_create_item_composition_table.php deleted file mode 100644 index cf7eaa0b7..000000000 --- a/database/migrations/2018_10_26_035551_create_item_composition_table.php +++ /dev/null @@ -1,70 +0,0 @@ -string('Name')->unique(); - $table->integer('ItemId'); - $table->decimal('m3Size', 10, 2)->default(0.00); - $table->integer('BatchSize')->default(100); - $table->integer('Tritanium')->default(0); - $table->integer('Pyerite')->default(0); - $table->integer('Mexallon')->default(0); - $table->integer('Isogen')->default(0); - $table->integer('Nocxium')->default(0); - $table->integer('Zydrine')->default(0); - $table->integer('Megacyte')->default(0); - $table->integer('Morphite')->default(0); - $table->integer('HeavyWater')->default(0); - $table->integer('LiquidOzone')->default(0); - $table->integer('NitrogenIsotopes')->default(0); - $table->integer('HeliumIsotopes')->default(0); - $table->integer('HydrogenIsotopes')->default(0); - $table->integer('OxygenIsotopes')->default(0); - $table->integer('StrontiumClathrates')->default(0); - $table->integer('AtmosphericGases')->default(0); - $table->integer('EvaporiteDeposits')->default(0); - $table->integer('Hydrocarbons')->default(0); - $table->integer('Silicates')->default(0); - $table->integer('Cobalt')->default(0); - $table->integer('Scandium')->default(0); - $table->integer('Titanium')->default(0); - $table->integer('Tungsten')->default(0); - $table->integer('Cadmium')->default(0); - $table->integer('Platinum')->default(0); - $table->integer('Vanadium')->default(0); - $table->integer('Chromium')->default(0); - $table->integer('Technetium')->default(0); - $table->integer('Hafnium')->default(0); - $table->integer('Caesium')->default(0); - $table->integer('Mercury')->default(0); - $table->integer('Dysprosium')->default(0); - $table->integer('Neodymium')->default(0); - $table->integer('Promethium')->default(0); - $table->integer('Thulium')->default(0); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('ItemComposition'); - } -} diff --git a/database/migrations/2018_10_27_055713_create_wiki_users.php b/database/migrations/2018_10_27_055713_create_wiki_users.php index 4a1d560eb..d0d6510f1 100644 --- a/database/migrations/2018_10_27_055713_create_wiki_users.php +++ b/database/migrations/2018_10_27_055713_create_wiki_users.php @@ -23,6 +23,23 @@ class CreateWikiUsers extends Migration $table->unique('login', 'user'); }); } + + if(!Schema::hasTable('wiki_member')) { + Schema::create('wiki_member', function(Blueprint $table) { + $table->integer('uid'); + $table->integer('gid'); + $table->string('groupname'); + $table->primary(['uid', 'gid']); + }); + } + + if(!Schema::hasTable('wiki_groupnames')) { + Schema::create('wiki_groupnames', function(Blueprint $table) { + $table->increments('id'); + $table->string('gname'); + $table->unique('id', 'id'); + }); + } } /** @@ -33,5 +50,7 @@ class CreateWikiUsers extends Migration public function down() { Schema::dropIfExists('wiki_user'); + Schema::dropIfExists('wiki_member'); + Schema::dropIfExists('wiki_groupname'); } } diff --git a/database/migrations/2018_10_27_055927_create_wiki_groupnames.php b/database/migrations/2018_10_27_055927_create_wiki_groupnames.php deleted file mode 100644 index 5de74bf8b..000000000 --- a/database/migrations/2018_10_27_055927_create_wiki_groupnames.php +++ /dev/null @@ -1,34 +0,0 @@ -increments('id'); - $table->string('gname'); - $table->unique('id', 'id'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('wiki_groupname'); - } -} diff --git a/database/migrations/2018_10_27_060042_create_wiki_member.php b/database/migrations/2018_10_27_060042_create_wiki_member.php deleted file mode 100644 index 56fcef1df..000000000 --- a/database/migrations/2018_10_27_060042_create_wiki_member.php +++ /dev/null @@ -1,35 +0,0 @@ -integer('uid'); - $table->integer('gid'); - $table->string('groupname'); - $table->primary(['uid', 'gid']); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('wiki_member'); - } -} diff --git a/database/migrations/2018_10_28_202354_create_market_orders.php b/database/migrations/2018_10_28_202354_create_market_orders.php deleted file mode 100644 index 42ea01de8..000000000 --- a/database/migrations/2018_10_28_202354_create_market_orders.php +++ /dev/null @@ -1,42 +0,0 @@ -integer('duration'); - $table->boolean('is_buy_order'); - $table->dateTime('issued'); - $table->integer('location_id'); - $table->integer('min_volume'); - $table->integer('order_id')->unique(); - $table->decimal('price', 20, 2); - $table->string('range'); - $table->integer('system_id'); - $table->integer('volume_remain'); - $table->integer('volume_total'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('MarketOrders'); - } -} diff --git a/database/migrations/2018_10_28_204313_create_structures.php b/database/migrations/2018_10_28_204313_create_structures.php index dcb075971..396518019 100644 --- a/database/migrations/2018_10_28_204313_create_structures.php +++ b/database/migrations/2018_10_28_204313_create_structures.php @@ -34,6 +34,32 @@ class CreateStructures extends Migration $table->timestamps(); }); } + + if(!Schema::hasTable('CorpStructures')) { + Schema::create('CorpStructures', function(Blueprint $table) { + $table->increments('id'); + $table->integer('character_id'); + $table->integer('corporation_id'); + $table->string('corporation_name'); + $table->string('region'); + $table->string('system'); + $table->string('structure_name'); + $table->decimal('tax', 10, 2); + $table->string('structure_type'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('corp_tax_ratios')) { + Schema::create('corp_tax_ratios', function (Blueprint $table) { + $table->increments('id'); + $table->string('corporation_id'); + $table->string('corporation_name'); + $table->string('structure_type'); + $table->string('ratio'); + $table->timestamps(); + }); + } } /** @@ -44,5 +70,7 @@ class CreateStructures extends Migration public function down() { Schema::dropIfExists('Structures'); + Schema::dropIfExists('CorpStructures'); + Schema::dropIfExists('corp_tax_ratios'); } } diff --git a/database/migrations/2018_10_29_001917_create_holding_corp_finances_journal.php b/database/migrations/2018_10_29_001917_create_holding_corp_finances_journal.php deleted file mode 100644 index 352e3fc03..000000000 --- a/database/migrations/2018_10_29_001917_create_holding_corp_finances_journal.php +++ /dev/null @@ -1,44 +0,0 @@ -integer('id')->unique(); - $table->decimal('amount', 20, 2); - $table->decimal('balance', 20, 2); - $table->integer('context_id'); - $table->string('context_id_type'); - $table->dateTime('date'); - $table->string('description'); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->nullabe(); - $table->string('ref_type'); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('HoldingcorpFinancesJournal'); - } -} diff --git a/database/migrations/2018_10_29_003021_create_esi_tokens.php b/database/migrations/2018_10_29_003021_create_esi_tokens.php deleted file mode 100644 index c0f4e42ea..000000000 --- a/database/migrations/2018_10_29_003021_create_esi_tokens.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->integer('character_id')->unique(); - $table->string('access_token'); - $table->string('refresh_token'); - $table->integer('expires_in'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('EsiTokens'); - } -} diff --git a/database/migrations/2018_11_05_001352_create_user_roles_table.php b/database/migrations/2018_11_05_001352_create_user_roles_table.php deleted file mode 100644 index edac82746..000000000 --- a/database/migrations/2018_11_05_001352_create_user_roles_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->integer('character_id')->unsigned(); - $table->foreign('character_id')->references('character_id')->on('users'); - $table->string('role')->default('None'); - - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('user_roles'); - } -} diff --git a/database/migrations/2018_11_06_013105_create_esi_scopes.php b/database/migrations/2018_11_06_013105_create_esi_scopes.php deleted file mode 100644 index 25871a6dd..000000000 --- a/database/migrations/2018_11_06_013105_create_esi_scopes.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->integer('character_id'); - $table->foreign('character_id')->references('character_id')->on('EsiTokens'); - $table->string('scope'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('EsiScopes'); - } -} diff --git a/database/migrations/2018_11_09_051006_create_fleets_table.php b/database/migrations/2018_11_09_051006_create_fleets_table.php deleted file mode 100644 index 4d8664588..000000000 --- a/database/migrations/2018_11_09_051006_create_fleets_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->string('character_id'); - $table->string('fleet')->unique(); - $table->text('description')->nullable(); - $table->dateTime('creation_time'); - $table->dateTime('fleet_end'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('Fleets'); - } -} diff --git a/database/migrations/2018_11_10_203310_drop_roles_column_user_table.php b/database/migrations/2018_11_10_203310_drop_roles_column_user_table.php deleted file mode 100644 index 3ca22784c..000000000 --- a/database/migrations/2018_11_10_203310_drop_roles_column_user_table.php +++ /dev/null @@ -1,34 +0,0 @@ -dropColumn('role'); - $table->dropColumn('scopes'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function(Blueprint $table) { - $table->string('role')->default('Guest'); - $table->text('scopes')->nullable(); - }); - } -} diff --git a/database/migrations/2018_11_17_053307_create_corp_journal.php b/database/migrations/2018_11_17_053307_create_corp_journal.php index 7923d895d..f3ce8ac06 100644 --- a/database/migrations/2018_11_17_053307_create_corp_journal.php +++ b/database/migrations/2018_11_17_053307_create_corp_journal.php @@ -33,6 +33,203 @@ class CreateCorpJournal extends Migration $table->timestamps(); }); } + + if(!Schema::hasTable('HoldingCorpFinancesJournal')) { + Schema::create('HoldingCorpFinancesJournal', function(Blueprint $table) { + $table->integer('id')->unique(); + $table->decimal('amount', 20, 2); + $table->decimal('balance', 20, 2); + $table->integer('context_id'); + $table->string('context_id_type'); + $table->dateTime('date'); + $table->string('description'); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->nullabe(); + $table->string('ref_type'); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + }); + } + + if(!Schema::hasTable('jump_bridge_journal')) { + Schema::create('jump_bridge_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->bigInteger('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('corp_market_journal')) { + Schema::create('corp_market_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->bigInteger('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('player_donation_journal')) { + Schema::create('player_donation_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->bigInteger('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('reprocessing_tax_journal')) { + Schema::create('reprocessing_tax_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->integer('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('office_fees_journal')) { + Schema::create('office_fees_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->integer('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('structure_industry_tax_journal')) { + Schema::create('structure_industry_tax_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->integer('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('planet_production_tax_journal')) { + Schema::create('planet_production_tax_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corporation_id')->nullabe(); + $table->integer('division')->default(0); + $table->decimal('amount', 20, 2)->nullable(); + $table->decimal('balance', 20, 2)->nullable(); + $table->integer('context_id')->nullable(); + $table->string('context_id_type')->nullable(); + $table->dateTime('date')->nullabe(); + $table->string('description')->nullabe(); + $table->integer('first_party_id')->nullable(); + $table->string('reason')->default(' '); + $table->string('ref_type')->nullabe(); + $table->integer('second_party_id')->nullable(); + $table->decimal('tax', 20, 2)->default(0.00); + $table->integer('tax_receiver_id')->nullable(); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('monthly_market_taxes')) { + Schema::create('monthly_market_taxes', function (Blueprint $table) { + $table->increments('id'); + $table->string('character_id'); + $table->string('character_name'); + $table->string('corporation_id'); + $table->string('corporation_name'); + $table->decimal('tax_owed', 20, 2); + $table->string('month'); + $table->string('year'); + $table->timestamps(); + }); + } + + if(!Schema::hasTable('pi_sale_journal')) { + Schema::create('pi_sale_journal', function(Blueprint $table) { + $table->string('id')->unique(); + $table->integer('corp_id'); + $table->integer('division'); + $table->integer('client_id'); + $table->string('date'); + $table->boolean('is_buy'); + $table->integer('journal_ref_id'); + $table->integer('location_id'); + $table->integer('quantity'); + $table->integer('transaction_id'); + $table->integer('type_id'); + $table->decimal('unit_price'); + $table->timestamps(); + }); + } } /** @@ -43,5 +240,15 @@ class CreateCorpJournal extends Migration public function down() { Schema::dropIfExists('CorpWalletJournals'); + Schema::dropIfExists('HoldingcorpFinancesJournal'); + Schema::dropIfExists('jump_bridge_journal'); + Schema::dropIfExists('corp_market_journal'); + Schema::dropIfExists('player_donation_journal'); + Schema::dropIfExists('reprocessing_tax_journal'); + Schema::dropIfExists('office_fees_journal'); + Schema::dropIfExists('structure_industry_tax'); + Schema::dropIfExists('planet_production_tax_journal'); + Schema::dropIfExists('monthly_market_taxes'); + Schema::dropIfExists('pi_sale_journal'); } } diff --git a/database/migrations/2018_11_18_224639_create_alliance_corps.php b/database/migrations/2018_11_18_224639_create_alliance_corps.php deleted file mode 100644 index da3596d4c..000000000 --- a/database/migrations/2018_11_18_224639_create_alliance_corps.php +++ /dev/null @@ -1,34 +0,0 @@ -integer('corporation_id')->unique(); - $table->string('name'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('AllianceCorps'); - } -} diff --git a/database/migrations/2018_11_19_053751_create_corp_structures.php b/database/migrations/2018_11_19_053751_create_corp_structures.php deleted file mode 100644 index 2595a1470..000000000 --- a/database/migrations/2018_11_19_053751_create_corp_structures.php +++ /dev/null @@ -1,41 +0,0 @@ -increments('id'); - $table->integer('character_id'); - $table->integer('corporation_id'); - $table->string('corporation_name'); - $table->string('region'); - $table->string('system'); - $table->string('structure_name'); - $table->decimal('tax', 10, 2); - $table->string('structure_type'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('CorpStructures'); - } -} diff --git a/database/migrations/2018_11_23_070613_create_schedule_jobs.php b/database/migrations/2018_11_23_070613_create_schedule_jobs.php deleted file mode 100644 index 231b7fb20..000000000 --- a/database/migrations/2018_11_23_070613_create_schedule_jobs.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('job_name'); - $table->string('job_state'); - $table->dateTime('system_time'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('schedule_jobs'); - } -} diff --git a/database/migrations/2018_12_02_023338_create_user_permissions_table.php b/database/migrations/2018_12_02_023338_create_user_permissions_table.php deleted file mode 100644 index 0e6594a75..000000000 --- a/database/migrations/2018_12_02_023338_create_user_permissions_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->integer('character_id')->unsigned(); - $table->foreign('character_id')->references('character_id')->on('users'); - $table->string('permission'); - $table->timestamps(); - }); - } - - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('user_permissions'); - } -} diff --git a/database/migrations/2018_12_02_035601_create_logistics_contracts_table.php b/database/migrations/2018_12_02_035601_create_logistics_contracts_table.php deleted file mode 100644 index 783448841..000000000 --- a/database/migrations/2018_12_02_035601_create_logistics_contracts_table.php +++ /dev/null @@ -1,44 +0,0 @@ -increments('id'); - $table->integer('shipper_id')->nullable(); - $table->string('shipper_name')->nullable(); - $table->integer('accepted_by_id')->nullable(); - $table->string('accepted_by_name')->nullable(); - $table->integer('start_system_id')->nullable(); - $table->string('start_system_name')->nullable(); - $table->integer('destination_system_id')->nullable(); - $table->string('destination_system_name')->nullable(); - $table->decimal('price', 20, 2)->default(0.00); - $table->decimal('collateral', 20, 2)->default(0.00); - $table->boolean('insured')->default(false); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('logistics_contracts'); - } -} diff --git a/database/migrations/2018_12_03_190335_create_fleets_activity_tracking_table.php b/database/migrations/2018_12_03_190335_create_fleets_activity_tracking_table.php deleted file mode 100644 index c6337d784..000000000 --- a/database/migrations/2018_12_03_190335_create_fleets_activity_tracking_table.php +++ /dev/null @@ -1,43 +0,0 @@ -increments('id'); - $table->string('fleetId'); - $table->string('character_id'); - $table->string('character_name')->nullable(); - $table->string('corporation_id'); - $table->string('corporation_name')->nullable(); - $table->string('region'); - $table->string('system'); - $table->string('ship'); - $table->string('ship_type')->nullable(); - $table->timestamps(); - }); - } - - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('fleets_activity_tracking'); - } -} diff --git a/database/migrations/2018_12_03_193037_drop_fleet_end_column_fleets_table.php b/database/migrations/2018_12_03_193037_drop_fleet_end_column_fleets_table.php deleted file mode 100644 index ab8db276b..000000000 --- a/database/migrations/2018_12_03_193037_drop_fleet_end_column_fleets_table.php +++ /dev/null @@ -1,34 +0,0 @@ -dropColumn('fleet_end'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('Fleets', function($table) { - $table->dateTime('fleet_end'); - }); - } -} diff --git a/database/migrations/2018_12_04_010600_create_user_to_corporation_table.php b/database/migrations/2018_12_04_010600_create_user_to_corporation_table.php deleted file mode 100644 index caab318b8..000000000 --- a/database/migrations/2018_12_04_010600_create_user_to_corporation_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->string('character_id'); - $table->string('character_name'); - $table->string('corporation_id'); - $table->string('corporation_name'); - }); - } - - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('user_to_corporation'); - } -} diff --git a/database/migrations/2018_12_07_053132_drop__structures_table.php b/database/migrations/2018_12_07_053132_drop__structures_table.php deleted file mode 100644 index cd5a831b5..000000000 --- a/database/migrations/2018_12_07_053132_drop__structures_table.php +++ /dev/null @@ -1,28 +0,0 @@ -increments('id'); - $table->string('character_id'); - $table->string('character_name'); - $table->string('corporation_id'); - $table->string('corporation_name'); - $table->decimal('tax_owed', 20, 2); - $table->string('month'); - $table->string('year'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('monthly_market_taxes'); - } -} diff --git a/database/migrations/2018_12_12_074812_create_player_donation_journals_table.php b/database/migrations/2018_12_12_074812_create_player_donation_journals_table.php deleted file mode 100644 index fa6134fe8..000000000 --- a/database/migrations/2018_12_12_074812_create_player_donation_journals_table.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->integer('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('PlayerDonationJournals'); - } -} diff --git a/database/migrations/2018_12_14_030608_drop_holding_corp_finances_journal_table.php b/database/migrations/2018_12_14_030608_drop_holding_corp_finances_journal_table.php deleted file mode 100644 index 0ca14fc09..000000000 --- a/database/migrations/2018_12_14_030608_drop_holding_corp_finances_journal_table.php +++ /dev/null @@ -1,28 +0,0 @@ -increments('id'); - $table->string('permission'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('available_user_permissions'); - } -} diff --git a/database/migrations/2018_12_21_220501_create_jump_bridge_journal.php b/database/migrations/2018_12_21_220501_create_jump_bridge_journal.php deleted file mode 100644 index c0b4ca7b7..000000000 --- a/database/migrations/2018_12_21_220501_create_jump_bridge_journal.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->bigInteger('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('jump_bridge_journal'); - } -} diff --git a/database/migrations/2018_12_21_222925_create_corp_market_journal.php b/database/migrations/2018_12_21_222925_create_corp_market_journal.php deleted file mode 100644 index 1459d92d0..000000000 --- a/database/migrations/2018_12_21_222925_create_corp_market_journal.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->bigInteger('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('corp_market_journal'); - } -} diff --git a/database/migrations/2018_12_21_223043_create_player_donation_journal.php b/database/migrations/2018_12_21_223043_create_player_donation_journal.php deleted file mode 100644 index 067fd1f3b..000000000 --- a/database/migrations/2018_12_21_223043_create_player_donation_journal.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->bigInteger('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('player_donation_journal'); - } -} diff --git a/database/migrations/2018_12_21_223222_create_reprocessing_tax_journal.php b/database/migrations/2018_12_21_223222_create_reprocessing_tax_journal.php deleted file mode 100644 index dbda048ce..000000000 --- a/database/migrations/2018_12_21_223222_create_reprocessing_tax_journal.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->integer('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('reprocessing_tax_journal'); - } -} diff --git a/database/migrations/2018_12_22_043405_create_character_to_corporation_table.php b/database/migrations/2018_12_22_043405_create_character_to_corporation_table.php deleted file mode 100644 index e1af83d91..000000000 --- a/database/migrations/2018_12_22_043405_create_character_to_corporation_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('character_id'); - $table->string('character_name'); - $table->string('corporation_id'); - $table->string('corporation_name'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('character_to_corporation'); - } -} diff --git a/database/migrations/2018_12_22_043420_create_corporation_to_alliance_table.php b/database/migrations/2018_12_22_043420_create_corporation_to_alliance_table.php deleted file mode 100644 index 92fa7bc39..000000000 --- a/database/migrations/2018_12_22_043420_create_corporation_to_alliance_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('corporation_id'); - $table->string('corporation_name'); - $table->string('alliance_id'); - $table->string('alliance_name'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('corporation_to_alliance'); - } -} diff --git a/database/migrations/2018_12_24_020905_create_jobs_table.php b/database/migrations/2018_12_24_020905_create_jobs_table.php index d7f0cda42..b5a2d76ff 100644 --- a/database/migrations/2018_12_24_020905_create_jobs_table.php +++ b/database/migrations/2018_12_24_020905_create_jobs_table.php @@ -24,7 +24,27 @@ class CreateJobsTable extends Migration $table->unsignedInteger('created_at'); }); } - + + if(!Schema::hasTable('failed_jobs')) { + Schema::create('failed_jobs', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + if(!Schema::hasTable('schedule_jobs')) { + Schema::create('schedule_jobs', function(Blueprint $table) { + $table->increments('id'); + $table->string('job_name'); + $table->string('job_state'); + $table->dateTime('system_time'); + $table->timestamps(); + }); + } } /** @@ -35,5 +55,7 @@ class CreateJobsTable extends Migration public function down() { Schema::dropIfExists('jobs'); + Schema::dropIfExists('failed_jobs'); + Schema::dropIfExists('schedule_jobs'); } } diff --git a/database/migrations/2018_12_24_034610_create_eve_mails_table.php b/database/migrations/2018_12_24_034610_create_eve_mails_table.php index 5f0dda336..72acea978 100644 --- a/database/migrations/2018_12_24_034610_create_eve_mails_table.php +++ b/database/migrations/2018_12_24_034610_create_eve_mails_table.php @@ -24,6 +24,17 @@ class CreateEveMailsTable extends Migration $table->timestamps(); }); } + + if(!Schema::hasTable('sent_mails')) { + Schema::create('sent_mails', function (Blueprint $table) { + $table->increments('id'); + $table->string('sender'); + $table->string('subject'); + $table->text('body'); + $table->string('recipient'); + $table->string('recipient_type'); + }); + } } /** @@ -34,5 +45,6 @@ class CreateEveMailsTable extends Migration public function down() { Schema::dropIfExists('eve_mails'); + Schema::dropIfExists('sent_mails'); } } diff --git a/database/migrations/2019_01_05_083656_create_structure_industry_tax_table.php b/database/migrations/2019_01_05_083656_create_structure_industry_tax_table.php deleted file mode 100644 index 729556cee..000000000 --- a/database/migrations/2019_01_05_083656_create_structure_industry_tax_table.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->integer('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('structure_industry_tax'); - } -} diff --git a/database/migrations/2019_01_06_074337_create_planet_production_tax_journal.php b/database/migrations/2019_01_06_074337_create_planet_production_tax_journal.php deleted file mode 100644 index 7dccb9542..000000000 --- a/database/migrations/2019_01_06_074337_create_planet_production_tax_journal.php +++ /dev/null @@ -1,48 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->integer('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('planet_production_tax_journal'); - } -} diff --git a/database/migrations/2019_01_06_074507_create_office_fees_journal.php b/database/migrations/2019_01_06_074507_create_office_fees_journal.php deleted file mode 100644 index ef3a8f438..000000000 --- a/database/migrations/2019_01_06_074507_create_office_fees_journal.php +++ /dev/null @@ -1,47 +0,0 @@ -string('id')->unique(); - $table->integer('corporation_id')->nullabe(); - $table->integer('division')->default(0); - $table->decimal('amount', 20, 2)->nullable(); - $table->decimal('balance', 20, 2)->nullable(); - $table->integer('context_id')->nullable(); - $table->string('context_id_type')->nullable(); - $table->dateTime('date')->nullabe(); - $table->string('description')->nullabe(); - $table->integer('first_party_id')->nullable(); - $table->string('reason')->default(' '); - $table->string('ref_type')->nullabe(); - $table->integer('second_party_id')->nullable(); - $table->decimal('tax', 20, 2)->default(0.00); - $table->integer('tax_receiver_id')->nullable(); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('office_fees_journal'); - } -} diff --git a/database/migrations/2019_01_07_160456_create_allowed_logins_table.php b/database/migrations/2019_01_07_160456_create_allowed_logins_table.php deleted file mode 100644 index 56557139e..000000000 --- a/database/migrations/2019_01_07_160456_create_allowed_logins_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->string('entity_id'); - $table->string('entity_type'); - $table->string('entity_name'); - $table->string('login_type'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('allowed_logins'); - } -} diff --git a/database/migrations/2019_01_08_015340_drop_users_role_column.php b/database/migrations/2019_01_08_015340_drop_users_role_column.php deleted file mode 100644 index f96c71304..000000000 --- a/database/migrations/2019_01_08_015340_drop_users_role_column.php +++ /dev/null @@ -1,32 +0,0 @@ -dropColumn('role'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2019_01_09_131616_create_users_role_table.php b/database/migrations/2019_01_09_131616_create_users_role_table.php deleted file mode 100644 index 4fb7c52d7..000000000 --- a/database/migrations/2019_01_09_131616_create_users_role_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->integer('character_id')->unsigned(); - $table->foreign('character_id')->references('character_id')->on('users'); - $table->string('role')->default('None'); - - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('user_roles'); - } -} diff --git a/database/migrations/2019_01_10_012924_create_failed_jobs_table.php b/database/migrations/2019_01_10_012924_create_failed_jobs_table.php deleted file mode 100644 index d432dff08..000000000 --- a/database/migrations/2019_01_10_012924_create_failed_jobs_table.php +++ /dev/null @@ -1,35 +0,0 @@ -bigIncrements('id'); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('failed_jobs'); - } -} diff --git a/database/migrations/2019_01_16_071621_create_corp_tax_ratios_table.php b/database/migrations/2019_01_16_071621_create_corp_tax_ratios_table.php deleted file mode 100644 index 3c87bf72c..000000000 --- a/database/migrations/2019_01_16_071621_create_corp_tax_ratios_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->string('corporation_id'); - $table->string('corporation_name'); - $table->string('structure_type'); - $table->string('ratio'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('corp_tax_ratios'); - } -} diff --git a/database/migrations/2019_01_19_062656_create_clones_table.php b/database/migrations/2019_01_19_062656_create_clones_table.php index b77fa2a5a..5524a685b 100644 --- a/database/migrations/2019_01_19_062656_create_clones_table.php +++ b/database/migrations/2019_01_19_062656_create_clones_table.php @@ -22,6 +22,14 @@ class CreateClonesTable extends Migration }); } + if(!Schema::hasTable('clones_mailing')) { + Schema::create('clones_mailing', function (Blueprint $table) { + $table->increments('id'); + $table->string('character_id'); + $table->integer('time_sent'); + $table->timestamps(); + }); + } } /** @@ -32,5 +40,6 @@ class CreateClonesTable extends Migration public function down() { Schema::dropIfExists('clones'); + Schema::dropIfExists('clones_mailing'); } } diff --git a/database/migrations/2019_02_04_221424_create_clones_mailing_table.php b/database/migrations/2019_02_04_221424_create_clones_mailing_table.php deleted file mode 100644 index e88a843e7..000000000 --- a/database/migrations/2019_02_04_221424_create_clones_mailing_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->string('character_id'); - $table->integer('time_sent'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('clones_mailing'); - } -} diff --git a/database/migrations/2019_02_04_222912_drop_playerdonationjournal_table.php b/database/migrations/2019_02_04_222912_drop_playerdonationjournal_table.php deleted file mode 100644 index 1c69b731c..000000000 --- a/database/migrations/2019_02_04_222912_drop_playerdonationjournal_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->string('role'); - $table->string('description'); - $table->timestamps(); - }); - - DB::table('available_user_roles')->insert([ - 'role' => 'None', - 'description' => 'User has no roles and is not allowed in the site.', - ]); - - DB::table('available_user_roles')->insert([ - 'role' => 'Guest', - 'description' => 'Guest of the site.', - ]); - - DB::table('available_user_roles')->insert([ - 'role' => 'Renter', - 'description' => 'Renters of W4RP.', - ]); - - DB::table('available_user_roles')->insert([ - 'role' => 'User', - 'description' => 'Members of Legacy allowed on the site.', - ]); - - DB::table('available_user_roles')->insert([ - 'role' => 'Admin', - 'description' => 'Admin of the site.', - ]); - - DB::table('available_user_roles')->insert([ - 'role' => 'SuperUser', - 'description' => 'Super user of the site.', - ]); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('available_user_roles'); - } -} diff --git a/database/migrations/2019_02_13_133855_create_moon_rents_table.php b/database/migrations/2019_02_13_133855_create_moon_rents_table.php deleted file mode 100644 index ae958330b..000000000 --- a/database/migrations/2019_02_13_133855_create_moon_rents_table.php +++ /dev/null @@ -1,38 +0,0 @@ -increments('id'); - $table->string('System'); - $table->string('Planet'); - $table->string('Moon'); - $table->string('RentalCorp'); - $table->dateTime('RentalEnd'); - $table->string('Contact'); - $table->string('Price'); - $table->string('Type'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('moon_rents'); - } -} diff --git a/database/migrations/2019_02_14_034232_drop_corp_structures_tax_column_table.php b/database/migrations/2019_02_14_034232_drop_corp_structures_tax_column_table.php deleted file mode 100644 index 846237427..000000000 --- a/database/migrations/2019_02_14_034232_drop_corp_structures_tax_column_table.php +++ /dev/null @@ -1,32 +0,0 @@ -dropColumn('tax'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2019_03_17_213915_create_sent_mails_table.php b/database/migrations/2019_03_17_213915_create_sent_mails_table.php deleted file mode 100644 index 07e8b27d7..000000000 --- a/database/migrations/2019_03_17_213915_create_sent_mails_table.php +++ /dev/null @@ -1,35 +0,0 @@ -increments('id'); - $table->string('sender'); - $table->string('subject'); - $table->text('body'); - $table->string('recipient'); - $table->string('recipient_type'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('sent_mails'); - } -} diff --git a/database/migrations/2019_04_03_031003_update_moon_rents_table.php b/database/migrations/2019_04_03_031003_update_moon_rents_table.php deleted file mode 100644 index f60859dd3..000000000 --- a/database/migrations/2019_04_03_031003_update_moon_rents_table.php +++ /dev/null @@ -1,32 +0,0 @@ -string('Paid'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/database/migrations/2019_04_19_000000_create_pi_sale_journals_table.php b/database/migrations/2019_04_19_000000_create_pi_sale_journals_table.php deleted file mode 100644 index a91cb0b39..000000000 --- a/database/migrations/2019_04_19_000000_create_pi_sale_journals_table.php +++ /dev/null @@ -1,44 +0,0 @@ -string('id')->unique(); - $table->integer('corp_id'); - $table->integer('division'); - $table->integer('client_id'); - $table->string('date'); - $table->boolean('is_buy'); - $table->integer('journal_ref_id'); - $table->integer('location_id'); - $table->integer('quantity'); - $table->integer('transaction_id'); - $table->integer('type_id'); - $table->decimal('unit_price'); - $table->timestamps(); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('pi_sale_journal'); - } -} diff --git a/database/migrations/2019_04_24_000000_modify_moons_table.php b/database/migrations/2019_04_24_000000_modify_moons_table.php deleted file mode 100644 index 054f91bee..000000000 --- a/database/migrations/2019_04_24_000000_modify_moons_table.php +++ /dev/null @@ -1,34 +0,0 @@ -string('Paid'); - }); - } - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('Moons', function (Blueprint $table) { - $table->dropColumn('Paid'); - }); - } -}