mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1318 No effective change - DDL review for ... ENH: native UUID-support for SqlServer
Shows the use of uniqueidentifier DB column type for UUID with sql server.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- Generated by ebean unknown at 2018-03-08T04:43:42.126Z
|
||||
-- Generated by ebean unknown at 2018-03-08T06:24:28.188Z
|
||||
create table asimple_bean (
|
||||
id numeric(19) not null,
|
||||
name nvarchar(255),
|
||||
@@ -155,37 +155,37 @@ create table bsimple_with_gen (
|
||||
create sequence bsimple_with_gen_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table bsite (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_bsite primary key (id)
|
||||
);
|
||||
|
||||
create table bsite_user (
|
||||
site_id nvarchar(40) not null,
|
||||
user_id nvarchar(40) not null,
|
||||
site_id uniqueidentifier not null,
|
||||
user_id uniqueidentifier not null,
|
||||
access_level integer,
|
||||
constraint ck_bsite_user_access_level check ( access_level in (0,1,2)),
|
||||
constraint pk_bsite_user primary key (site_id,user_id)
|
||||
);
|
||||
|
||||
create table bsite_user_b (
|
||||
site nvarchar(40) not null,
|
||||
usr nvarchar(40) not null,
|
||||
site uniqueidentifier not null,
|
||||
usr uniqueidentifier not null,
|
||||
access_level integer,
|
||||
constraint ck_bsite_user_b_access_level check ( access_level in (0,1,2)),
|
||||
constraint pk_bsite_user_b primary key (site,usr)
|
||||
);
|
||||
|
||||
create table bsite_user_c (
|
||||
site_uid nvarchar(40) not null,
|
||||
user_uid nvarchar(40) not null,
|
||||
site_uid uniqueidentifier not null,
|
||||
user_uid uniqueidentifier not null,
|
||||
access_level integer,
|
||||
constraint ck_bsite_user_c_access_level check ( access_level in (0,1,2)),
|
||||
constraint pk_bsite_user_c primary key (site_uid,user_uid)
|
||||
);
|
||||
|
||||
create table buser (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_buser primary key (id)
|
||||
);
|
||||
@@ -1454,7 +1454,7 @@ create sequence imroot_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table ixresource (
|
||||
dtype nvarchar(255),
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_ixresource primary key (id)
|
||||
);
|
||||
@@ -2013,7 +2013,7 @@ create unique nonclustered index uq_ocompany_corp_id on ocompany(corp_id) where
|
||||
create sequence ocompany_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table oengine (
|
||||
engine_id nvarchar(40) not null,
|
||||
engine_id uniqueidentifier not null,
|
||||
short_desc nvarchar(255),
|
||||
car_id integer,
|
||||
version integer not null,
|
||||
@@ -2022,7 +2022,7 @@ create table oengine (
|
||||
create unique nonclustered index uq_oengine_car_id on oengine(car_id) where car_id is not null;
|
||||
|
||||
create table ogear_box (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
box_desc nvarchar(255),
|
||||
box_size integer,
|
||||
car_id integer,
|
||||
@@ -2220,28 +2220,28 @@ create table oto_th_top (
|
||||
create sequence oto_th_top_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table oto_ubprime (
|
||||
pid nvarchar(40) not null,
|
||||
pid uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
version numeric(19) not null,
|
||||
constraint pk_oto_ubprime primary key (pid)
|
||||
);
|
||||
|
||||
create table oto_ubprime_extra (
|
||||
eid nvarchar(40) not null,
|
||||
eid uniqueidentifier not null,
|
||||
extra nvarchar(255),
|
||||
version numeric(19) not null,
|
||||
constraint pk_oto_ubprime_extra primary key (eid)
|
||||
);
|
||||
|
||||
create table oto_uprime (
|
||||
pid nvarchar(40) not null,
|
||||
pid uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
version numeric(19) not null,
|
||||
constraint pk_oto_uprime primary key (pid)
|
||||
);
|
||||
|
||||
create table oto_uprime_extra (
|
||||
eid nvarchar(40) not null,
|
||||
eid uniqueidentifier not null,
|
||||
extra nvarchar(255),
|
||||
version numeric(19) not null,
|
||||
constraint pk_oto_uprime_extra primary key (eid)
|
||||
@@ -2272,7 +2272,7 @@ create table pfile_content (
|
||||
create sequence pfile_content_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table paggview (
|
||||
pview_id nvarchar(40),
|
||||
pview_id uniqueidentifier,
|
||||
amount integer not null
|
||||
);
|
||||
create unique nonclustered index uq_paggview_pview_id on paggview(pview_id) where pview_id is not null;
|
||||
@@ -2344,7 +2344,7 @@ create table c_participation (
|
||||
create sequence c_participation_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table mt_permission (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_mt_permission primary key (id)
|
||||
);
|
||||
@@ -2415,15 +2415,15 @@ create table o_product (
|
||||
create sequence o_product_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table pp (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
value nvarchar(100) not null,
|
||||
constraint pk_pp primary key (id)
|
||||
);
|
||||
|
||||
create table pp_to_ww (
|
||||
pp_id nvarchar(40) not null,
|
||||
ww_id nvarchar(40) not null,
|
||||
pp_id uniqueidentifier not null,
|
||||
ww_id uniqueidentifier not null,
|
||||
constraint pk_pp_to_ww primary key (pp_id,ww_id)
|
||||
);
|
||||
|
||||
@@ -2474,16 +2474,16 @@ create table em_role (
|
||||
create sequence em_role_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table mt_role (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(50),
|
||||
tenant_id nvarchar(40),
|
||||
tenant_id uniqueidentifier,
|
||||
version numeric(19) not null,
|
||||
constraint pk_mt_role primary key (id)
|
||||
);
|
||||
|
||||
create table mt_role_permission (
|
||||
mt_role_id nvarchar(40) not null,
|
||||
mt_permission_id nvarchar(40) not null,
|
||||
mt_role_id uniqueidentifier not null,
|
||||
mt_permission_id uniqueidentifier not null,
|
||||
constraint pk_mt_role_permission primary key (mt_role_id,mt_permission_id)
|
||||
);
|
||||
|
||||
@@ -2737,7 +2737,7 @@ create table ts_master_two (
|
||||
create sequence ts_master_two_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table tuuid_entity (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_tuuid_entity primary key (id)
|
||||
);
|
||||
@@ -2758,7 +2758,7 @@ create table twith_pre_insert (
|
||||
create sequence twith_pre_insert_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table mt_tenant (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
version numeric(19) not null,
|
||||
constraint pk_mt_tenant primary key (id)
|
||||
@@ -2849,15 +2849,15 @@ create table ut_master (
|
||||
create sequence ut_master_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table uuone (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
constraint pk_uuone primary key (id)
|
||||
);
|
||||
|
||||
create table uutwo (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(255),
|
||||
master_id nvarchar(40),
|
||||
master_id uniqueidentifier,
|
||||
constraint pk_uutwo primary key (id)
|
||||
);
|
||||
|
||||
@@ -3013,7 +3013,7 @@ create table parent (
|
||||
create sequence parent_seq as bigint start with 1 increment by 50;
|
||||
|
||||
create table wview (
|
||||
id nvarchar(40) not null,
|
||||
id uniqueidentifier not null,
|
||||
name nvarchar(127) not null,
|
||||
constraint uq_wview_name unique (name),
|
||||
constraint pk_wview primary key (id)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Generated by ebean unknown at 2018-03-08T04:43:42.126Z
|
||||
-- Generated by ebean unknown at 2018-03-08T06:24:28.188Z
|
||||
IF OBJECT_ID('fk_bar_foo_id', 'F') IS NOT NULL alter table bar drop constraint fk_bar_foo_id;
|
||||
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('bar','U') AND name = 'ix_bar_foo_id') drop index ix_bar_foo_id ON bar;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user