Work on products, first completed broadband

This commit is contained in:
Deon George
2021-12-24 12:14:01 +11:00
parent 8f5293662e
commit 1e9f15b40f
62 changed files with 2139 additions and 894 deletions

View File

@@ -10,9 +10,8 @@ use Illuminate\Support\Facades\Schema;
| ab_account_log |
| ab_account_memo |
| ab_account_oauth |
| ab_adsl_plan |
| ab_adsl_supplier |
| ab_adsl_supplier_plan |
| product_broadband |*DONE*
| supplier_broadband |*DONE*
| ab_affiliate |
| ab_asset |
| ab_asset_pool |
@@ -48,7 +47,7 @@ use Illuminate\Support\Facades\Schema;
| ab_module_method_token |
| ab_oauth |
| ab_pivot_product_cat |
| ab_product |
| products |*PARTIAL* - make model/model_id NOT NULL
| ab_product_cat |
| ab_product_cat_translate |
| ab_product_translate |
@@ -71,7 +70,7 @@ use Illuminate\Support\Facades\Schema;
| ab_task |
| ab_task_log |
| ab_voip_plan |
| accounts |*PARTIAL*
| accounts |*PARTIAL* - make timestamp columns, make date_expire timestamp
| charges |
| countries |*DONE*
| currencies |*DONE*
@@ -98,7 +97,7 @@ use Illuminate\Support\Facades\Schema;
| supplier_details |*DONE*
| suppliers |*DONE*
| taxes |*DONE*
| users |*PARTIAL*
| users |*DONE*
*/
class IntUnsigned extends Migration
{
@@ -322,7 +321,8 @@ class IntUnsigned extends Migration
DB::statement('ALTER TABLE users MODIFY country_id int unsigned NOT NULL,MODIFY language_id int unsigned NOT NULL,MODIFY currency_id int unsigned NOT NULL');
Schema::table('users', function (Blueprint $table) {
$table->foreign(['country_id','currency_id'])->references(['id','currency_id'])->on('countries');
$table->dropColumn(['currency_id']);
$table->foreign(['country_id'])->references(['id'])->on('countries');
$table->foreign(['parent_id','site_id'])->references(['id','site_id'])->on('users');
$table->foreign(['language_id'])->references(['id'])->on('languages');
});
@@ -332,11 +332,11 @@ class IntUnsigned extends Migration
DB::statement('ALTER TABLE accounts MODIFY site_id int unsigned NOT NULL');
DB::statement('ALTER TABLE accounts MODIFY country_id int unsigned NOT NULL,MODIFY language_id int unsigned NOT NULL,MODIFY currency_id int unsigned NOT NULL,MODIFY rtm_id int unsigned DEFAULT NULL,MODIFY active tinyint(1) NOT NULL');
Schema::table('accounts', function (Blueprint $table) {
$table->dropColumn(['currency_id','language_id']);
$table->foreign(['site_id'])->references(['site_id'])->on('sites');
$table->index(['id','site_id']);
$table->foreign(['country_id','currency_id'])->references(['id','currency_id'])->on('countries');
$table->foreign(['country_id'])->references(['id'])->on('countries');
$table->foreign(['user_id','site_id'])->references(['id','site_id'])->on('users');
$table->foreign(['language_id'])->references(['id'])->on('languages');
$table->foreign(['rtm_id','site_id'])->references(['id','site_id'])->on('rtm');
});