mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 21:15:52 +00:00
#1774 - Change built in SQL Server I___create_procs DDL script to use GO (and not $$ delimiters)
This commit is contained in:
@@ -141,7 +141,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-migration</artifactId>
|
||||
<version>11.17.1</version>
|
||||
<version>11.18.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,15 +4,21 @@
|
||||
<ddl-script name="create procs" platforms="sqlserver" init="true">-- Initial script to create stored procedures etc for sqlserver platform
|
||||
|
||||
-- create table-value-parameters
|
||||
if not exists (select name from sys.types where name = 'ebean_bigint_tvp') create type ebean_bigint_tvp as table (c1 bigint);
|
||||
if not exists (select name from sys.types where name = 'ebean_float_tvp') create type ebean_float_tvp as table (c1 float);
|
||||
if not exists (select name from sys.types where name = 'ebean_bit_tvp') create type ebean_bit_tvp as table (c1 bit);
|
||||
if not exists (select name from sys.types where name = 'ebean_date_tvp') create type ebean_date_tvp as table (c1 date);
|
||||
if not exists (select name from sys.types where name = 'ebean_time_tvp') create type ebean_time_tvp as table (c1 time);
|
||||
if not exists (select name from sys.types where name = 'ebean_uniqueidentifier_tvp') create type ebean_uniqueidentifier_tvp as table (c1 uniqueidentifier);
|
||||
if not exists (select name from sys.types where name = 'ebean_nvarchar_tvp') create type ebean_nvarchar_tvp as table (c1 nvarchar(max));
|
||||
if not exists (select name from sys.types where name = 'ebean_bigint_tvp') create type ebean_bigint_tvp as table (c1 bigint)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_float_tvp') create type ebean_float_tvp as table (c1 float)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_bit_tvp') create type ebean_bit_tvp as table (c1 bit)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_date_tvp') create type ebean_date_tvp as table (c1 date)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_time_tvp') create type ebean_time_tvp as table (c1 time)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_uniqueidentifier_tvp') create type ebean_uniqueidentifier_tvp as table (c1 uniqueidentifier)
|
||||
GO
|
||||
if not exists (select name from sys.types where name = 'ebean_nvarchar_tvp') create type ebean_nvarchar_tvp as table (c1 nvarchar(max))
|
||||
GO
|
||||
|
||||
delimiter $$
|
||||
--
|
||||
-- PROCEDURE: usp_ebean_drop_indices TABLE, COLUMN
|
||||
-- deletes all indices referring to TABLE.COLUMN
|
||||
@@ -38,9 +44,8 @@ BEGIN
|
||||
CLOSE index_cursor;
|
||||
DEALLOCATE index_cursor;
|
||||
END
|
||||
$$
|
||||
GO
|
||||
|
||||
delimiter $$
|
||||
--
|
||||
-- PROCEDURE: usp_ebean_drop_default_constraint TABLE, COLUMN
|
||||
-- deletes the default constraint, which has a random name
|
||||
@@ -55,9 +60,8 @@ BEGIN
|
||||
|
||||
if @tmp is not null EXEC('alter table ' + @tableName +' drop constraint ' + @tmp);
|
||||
END
|
||||
$$
|
||||
GO
|
||||
|
||||
delimiter $$
|
||||
--
|
||||
-- PROCEDURE: usp_ebean_drop_constraints TABLE, COLUMN
|
||||
-- deletes constraints and foreign keys refering to TABLE.COLUMN
|
||||
@@ -89,9 +93,8 @@ BEGIN
|
||||
CLOSE name_cursor;
|
||||
DEALLOCATE name_cursor;
|
||||
END
|
||||
$$
|
||||
GO
|
||||
|
||||
delimiter $$
|
||||
--
|
||||
-- PROCEDURE: usp_ebean_drop_column TABLE, COLUMN
|
||||
-- deletes the column annd ensures that all indices and constraints are dropped first
|
||||
@@ -107,7 +110,7 @@ BEGIN
|
||||
set @sql = 'alter table ' + @tableName + ' drop column ' + @columnName;
|
||||
EXECUTE(@sql);
|
||||
END
|
||||
$$
|
||||
GO
|
||||
</ddl-script>
|
||||
|
||||
<ddl-script name="create procs" platforms="mysql" init="true">-- Inital script to create stored procedures etc for mysql platform
|
||||
|
||||
Reference in New Issue
Block a user