Adding Custom domains (#247)

* WIP

* wip

* Finished doing most of the work
This commit is contained in:
Julien Nahum
2023-11-29 14:53:08 +01:00
committed by GitHub
parent 57fdfb25a0
commit b50f579155
33 changed files with 1210 additions and 267 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$driver = DB::getDriverName();
Schema::table('workspaces', function (Blueprint $table) use ($driver){
if ($driver === 'mysql') {
$table->json('custom_domains')->default(new Expression("(JSON_OBJECT())"))->nullable(true);
} else {
$table->json('custom_domains')->default('{}')->nullable(true);
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('workspaces', function (Blueprint $table) {
$table->dropColumn('custom_domains');
});
}
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('forms', function (Blueprint $table) {
$table->string('custom_domain')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('forms', function (Blueprint $table) {
$table->dropColumn(['custom_domain']);
});
}
};