Dialect.VERSION = 1.4.0
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name=[new_table] AND xtype='U')
CREATE TABLE [new_table] (
id BIGINT NOT NULL,
name VARCHAR(100) NOT NULL DEFAULT '',
categoryid BIGINT NOT NULL DEFAULT 0,
companyid BIGINT NOT NULL DEFAULT 0,
fields TEXT NOT NULL DEFAULT '',
start DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
end DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
status SMALLINT NOT NULL DEFAULT 0,
extra TEXT NOT NULL DEFAULT ''
)
GO
CREATE VIEW IF NOT EXISTS [new_view] (
id,
name
) AS SELECT id, name FROM another_table
|