I have a table in SQL Server database where a column has a dot in its name. When I first created manually the table I had no problems doing it, but now that I’m changing the db server I decided to recreate the db structure using migrations and here comes the problem: I can’t create the columns with a dot in the name.
If I write
public function up()
{
Schema::connection('ConnectionName')->create('table', function(Blueprint $table) {
$table->id();
$table->boolean('Active');
$table->string('Table2.Column1')->nullable();
$table->string('Table2.Column2')->nullable();
$table->string('Table3.Column1')->nullable();
});
}
and run the migration I get an error because the commands get converted in SQL like
create table "table" (
"id" bigint identity primary key not null,
"Active" bit not null,
"Table2"."Column1" nvarchar(255) null,
"Table2"."Column2" nvarchar(255) null,
"Table3"."Column1" nvarchar(255) null
)
As you can see the columns with the dot in the name have a double quotes around the dot, is there any way?