## mysql
# A_WatermarkImage_1.0
ALTER TABLE DB_TABLE_PREFIXWatermarkImage
  DROP INDEX DB_COLUMN_PREFIXname;

UPDATE DB_TABLE_PREFIXSchema
  SET DB_COLUMN_PREFIXmajor=1, DB_COLUMN_PREFIXminor=1
  WHERE DB_COLUMN_PREFIXname='WatermarkImage' AND DB_COLUMN_PREFIXmajor=1 AND DB_COLUMN_PREFIXminor=0;

# WatermarkImage
CREATE TABLE DB_TABLE_PREFIXWatermarkImage(
 DB_COLUMN_PREFIXid int(11) NOT NULL,
 DB_COLUMN_PREFIXapplyToPreferred int(1),
 DB_COLUMN_PREFIXapplyToResizes int(1),
 DB_COLUMN_PREFIXapplyToThumbnail int(1),
 DB_COLUMN_PREFIXname varchar(128) NOT NULL,
 DB_COLUMN_PREFIXfileName varchar(128) NOT NULL,
 DB_COLUMN_PREFIXmimeType varchar(128),
 DB_COLUMN_PREFIXsize int(11),
 DB_COLUMN_PREFIXwidth int(11),
 DB_COLUMN_PREFIXheight int(11),
 DB_COLUMN_PREFIXownerId int(11),
 DB_COLUMN_PREFIXxPercentage varchar(32),
 DB_COLUMN_PREFIXyPercentage varchar(32),
 PRIMARY KEY(DB_COLUMN_PREFIXid),
 UNIQUE (DB_COLUMN_PREFIXfileName)
) DB_TABLE_TYPE
/*!40100 DEFAULT CHARACTER SET utf8 */;

INSERT INTO DB_TABLE_PREFIXSchema (
 DB_COLUMN_PREFIXname,
 DB_COLUMN_PREFIXmajor,
 DB_COLUMN_PREFIXminor
) VALUES('WatermarkImage', 1, 1);

## postgres
# A_WatermarkImage_1.0
DROP INDEX DB_TABLE_PREFIXWatermarkImage_84326;

UPDATE DB_TABLE_PREFIXSchema
  SET DB_COLUMN_PREFIXmajor=1, DB_COLUMN_PREFIXminor=1
  WHERE DB_COLUMN_PREFIXname='WatermarkImage' AND DB_COLUMN_PREFIXmajor=1 AND DB_COLUMN_PREFIXminor=0;

# WatermarkImage
CREATE TABLE DB_TABLE_PREFIXWatermarkImage(
 DB_COLUMN_PREFIXid INTEGER NOT NULL,
 DB_COLUMN_PREFIXapplyToPreferred SMALLINT,
 DB_COLUMN_PREFIXapplyToResizes SMALLINT,
 DB_COLUMN_PREFIXapplyToThumbnail SMALLINT,
 DB_COLUMN_PREFIXname VARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXfileName VARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXmimeType VARCHAR(128),
 DB_COLUMN_PREFIXsize INTEGER,
 DB_COLUMN_PREFIXwidth INTEGER,
 DB_COLUMN_PREFIXheight INTEGER,
 DB_COLUMN_PREFIXownerId INTEGER,
 DB_COLUMN_PREFIXxPercentage VARCHAR(32),
 DB_COLUMN_PREFIXyPercentage VARCHAR(32)
);

ALTER TABLE DB_TABLE_PREFIXWatermarkImage ADD PRIMARY KEY (DB_COLUMN_PREFIXid);

CREATE UNIQUE INDEX DB_TABLE_PREFIXWatermarkImage_99259 ON DB_TABLE_PREFIXWatermarkImage(DB_COLUMN_PREFIXfileName);

INSERT INTO DB_TABLE_PREFIXSchema (
 DB_COLUMN_PREFIXname,
 DB_COLUMN_PREFIXmajor,
 DB_COLUMN_PREFIXminor
) VALUES('WatermarkImage', 1, 1);

## oracle
# A_WatermarkImage_1.0
ALTER TABLE DB_TABLE_PREFIXWatermarkImage
  DROP UNIQUE (DB_COLUMN_PREFIXname);

UPDATE DB_TABLE_PREFIXSchema
  SET DB_COLUMN_PREFIXmajor=1, DB_COLUMN_PREFIXminor=1
  WHERE DB_COLUMN_PREFIXname='WatermarkImage' AND DB_COLUMN_PREFIXmajor=1 AND DB_COLUMN_PREFIXminor=0;

# WatermarkImage
CREATE TABLE DB_TABLE_PREFIXWatermarkImage(
 DB_COLUMN_PREFIXid INTEGER NOT NULL,
 DB_COLUMN_PREFIXapplyToPreferred NUMBER(1),
 DB_COLUMN_PREFIXapplyToResizes NUMBER(1),
 DB_COLUMN_PREFIXapplyToThumbnail NUMBER(1),
 DB_COLUMN_PREFIXname VARCHAR2(128) NOT NULL,
 DB_COLUMN_PREFIXfileName VARCHAR2(128) NOT NULL,
 DB_COLUMN_PREFIXmimeType VARCHAR2(128),
 DB_COLUMN_PREFIXsize INTEGER,
 DB_COLUMN_PREFIXwidth INTEGER,
 DB_COLUMN_PREFIXheight INTEGER,
 DB_COLUMN_PREFIXownerId INTEGER,
 DB_COLUMN_PREFIXxPercentage VARCHAR2(32),
 DB_COLUMN_PREFIXyPercentage VARCHAR2(32)
);

ALTER TABLE DB_TABLE_PREFIXWatermarkImage
 ADD PRIMARY KEY (DB_COLUMN_PREFIXid)
 ADD UNIQUE (DB_COLUMN_PREFIXfileName)
;

INSERT INTO DB_TABLE_PREFIXSchema (
 DB_COLUMN_PREFIXname,
 DB_COLUMN_PREFIXmajor,
 DB_COLUMN_PREFIXminor
) VALUES('WatermarkImage', 1, 1);

## db2
# A_WatermarkImage_1.0
DROP INDEX DB_TABLE_PREFIXWatermarkImage_84326;

UPDATE DB_TABLE_PREFIXSchema
  SET DB_COLUMN_PREFIXmajor=1, DB_COLUMN_PREFIXminor=1
  WHERE DB_COLUMN_PREFIXname='WatermarkImage' AND DB_COLUMN_PREFIXmajor=1 AND DB_COLUMN_PREFIXminor=0;

# WatermarkImage
CREATE TABLE DB_TABLE_PREFIXWatermarkImage(
 DB_COLUMN_PREFIXid INTEGER NOT NULL,
 DB_COLUMN_PREFIXapplyToPreferred SMALLINT,
 DB_COLUMN_PREFIXapplyToResizes SMALLINT,
 DB_COLUMN_PREFIXapplyToThumbnail SMALLINT,
 DB_COLUMN_PREFIXname VARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXfileName VARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXmimeType VARCHAR(128),
 DB_COLUMN_PREFIXsize INTEGER,
 DB_COLUMN_PREFIXwidth INTEGER,
 DB_COLUMN_PREFIXheight INTEGER,
 DB_COLUMN_PREFIXownerId INTEGER,
 DB_COLUMN_PREFIXxPercentage VARCHAR(32),
 DB_COLUMN_PREFIXyPercentage VARCHAR(32)
);

ALTER TABLE DB_TABLE_PREFIXWatermarkImage ADD PRIMARY KEY (DB_COLUMN_PREFIXid);

CREATE UNIQUE INDEX DB_TABLE_PREFIXWater7b_99259  
 ON DB_TABLE_PREFIXWatermarkImage(DB_COLUMN_PREFIXfileName);

INSERT INTO DB_TABLE_PREFIXSchema (
 DB_COLUMN_PREFIXname,
 DB_COLUMN_PREFIXmajor,
 DB_COLUMN_PREFIXminor
) VALUES('WatermarkImage', 1, 1);

## mssql
# A_WatermarkImage_1.0
DROP INDEX DB_TABLE_PREFIXWatermarkImage_84326;

UPDATE DB_TABLE_PREFIXSchema
  SET DB_COLUMN_PREFIXmajor=1, DB_COLUMN_PREFIXminor=1
  WHERE DB_COLUMN_PREFIXname='WatermarkImage' AND DB_COLUMN_PREFIXmajor=1 AND DB_COLUMN_PREFIXminor=0;

# WatermarkImage
CREATE TABLE DB_TABLE_PREFIXWatermarkImage(
 DB_COLUMN_PREFIXid INT NOT NULL,
 DB_COLUMN_PREFIXapplyToPreferred BIT NULL,
 DB_COLUMN_PREFIXapplyToResizes BIT NULL,
 DB_COLUMN_PREFIXapplyToThumbnail BIT NULL,
 DB_COLUMN_PREFIXname NVARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXfileName NVARCHAR(128) NOT NULL,
 DB_COLUMN_PREFIXmimeType NVARCHAR(128) NULL,
 DB_COLUMN_PREFIXsize INT NULL,
 DB_COLUMN_PREFIXwidth INT NULL,
 DB_COLUMN_PREFIXheight INT NULL,
 DB_COLUMN_PREFIXownerId INT NULL,
 DB_COLUMN_PREFIXxPercentage NVARCHAR(32) NULL,
 DB_COLUMN_PREFIXyPercentage NVARCHAR(32) NULL
);

ALTER TABLE DB_TABLE_PREFIXWatermarkImage ADD PRIMARY KEY (DB_COLUMN_PREFIXid);

CREATE UNIQUE INDEX DB_TABLE_PREFIXWatermarkImage_99259 ON DB_TABLE_PREFIXWatermarkImage(DB_COLUMN_PREFIXfileName);

INSERT INTO DB_TABLE_PREFIXSchema (
 DB_COLUMN_PREFIXname,
 DB_COLUMN_PREFIXmajor,
 DB_COLUMN_PREFIXminor
) VALUES('WatermarkImage', 1, 1);

