github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/queries/ddl/connection.sql (about)

     1  -- Content managed by Project Forge, see [projectforge.md] for details.
     2  -- {% func ConnectionDrop() %}
     3  if exists (select * from sysobjects where name='connection' and xtype='U')
     4  drop table "connection";
     5  -- {% endfunc %}
     6  
     7  -- {% func ConnectionCreate() %}
     8  if not exists (select * from sysobjects where name='connection' and xtype='U')
     9  create table "connection" (
    10    "id" uniqueidentifier not null,
    11    "name" nvarchar(max) not null,
    12    "icon" nvarchar(max) not null,
    13    "engine" nvarchar(255) not null,
    14    "server" nvarchar(max) not null,
    15    "port" int not null,
    16    "username" nvarchar(max) not null,
    17    "password" nvarchar(max) not null,
    18    "database" nvarchar(max) not null,
    19    "schema" nvarchar(max) not null,
    20    "conn_override" nvarchar(max) not null,
    21    primary key ("id")
    22  );
    23  
    24  if not exists (select * from sys.indexes where name='connection' and object_id=object_id('connection__engine_idx'))
    25  create index "connection__engine_idx" on "connection" ("engine");
    26  -- {% endfunc %}