Generate Table DDL How to include schema?

Answered

Hi,

 

I am wondering if it's possible to some set it so datagrip include the schema when generating the DDL for a table

right click table -> sql scripts -> generate ddl to clipboard/query console

Right now the table ddl is generated but the schema isn't included. Looking for that to be included as well.

2
3 comments

Hi! the same here…

example. i have some db - “SomeDb”, one user and 2 schemas
- dto - default schema
- ctm - my custom schema

SQL Generator do job for dto without any problem. But when i want generate script for “ctm” schema - its not specify schema for table create.

SQL Generator generate just some like this:

create table MyTable
(
    Id             int identity primary key,
    State          int default 0 not null,
    Type     bit default 0 not null
)

but should (expected) be some like:

create table [ctm].MyTable
(
    Id             int identity primary key,
    State          int default 0 not null,
    Type     bit default 0 not null
)

Thanks

 

0

UDP. Sorry, i missed that this feature already implemented.

in Qualify objects with shema names - just change “auto” to “Always”.

Thanks!

0

Please sign in to leave a comment.