We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, it's possible to edit char_migration with this code? It fix error on postgres for modify function that not exist
public function up() { Schema::table(\Config::get('countries.table_name'), function ($table) { if (env('DB_CONNECTION') == 'pgsql') { DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN country_code TYPE CHAR(3)"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN iso_3166_2 TYPE CHAR(2)"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN iso_3166_3 TYPE CHAR(3) "); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN region_code TYPE CHAR(3)"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN sub_region_code TYPE CHAR(3)"); } else { DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY country_code CHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY iso_3166_2 CHAR(2) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY iso_3166_3 CHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY region_code CHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY sub_region_code CHAR(3) NOT NULL DEFAULT ''"); } }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table(\Config::get('countries.table_name'), function ($table) { if (env('DB_CONNECTION') == 'pgsql') { DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN country_code VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN iso_3166_2 VARCHAR(2) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN iso_3166_3 VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN region_code VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " ALTER COLUMN sub_region_code VARCHAR(3) NOT NULL DEFAULT ''"); } else { DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY country_code VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY iso_3166_2 VARCHAR(2) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY iso_3166_3 VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY region_code VARCHAR(3) NOT NULL DEFAULT ''"); DB::statement("ALTER TABLE " . DB::getTablePrefix() . \Config::get('countries.table_name') . " MODIFY sub_region_code VARCHAR(3) NOT NULL DEFAULT ''"); } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, it's possible to edit char_migration with this code?
It fix error on postgres for modify function that not exist
The text was updated successfully, but these errors were encountered: