Skip to content

Commit

Permalink
#1485420: remove default (and not null) for users.language column in DDL
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Nov 25, 2008
1 parent 938e96a commit debdda0
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions SQL/mssql.initial.sql
Expand Up @@ -69,7 +69,7 @@ CREATE TABLE [dbo].[users] (
[alias] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , [alias] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
[created] [datetime] NOT NULL , [created] [datetime] NOT NULL ,
[last_login] [datetime] NULL , [last_login] [datetime] NULL ,
[language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL , [language] [varchar] (5) COLLATE Latin1_General_CI_AI NULL ,
[preferences] [text] COLLATE Latin1_General_CI_AI NOT NULL [preferences] [text] COLLATE Latin1_General_CI_AI NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO GO
Expand Down Expand Up @@ -202,7 +202,6 @@ ALTER TABLE [dbo].[users] ADD
CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host], CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host],
CONSTRAINT [DF_users_alias] DEFAULT ('') FOR [alias], CONSTRAINT [DF_users_alias] DEFAULT ('') FOR [alias],
CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created], CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created],
CONSTRAINT [DF_users_language] DEFAULT ('en') FOR [language]
GO GO


CREATE INDEX [IX_users_username] ON [dbo].[users]([username]) ON [PRIMARY] CREATE INDEX [IX_users_username] ON [dbo].[users]([username]) ON [PRIMARY]
Expand Down
2 changes: 1 addition & 1 deletion SQL/mysql.initial.sql
Expand Up @@ -90,7 +90,7 @@ CREATE TABLE `users` (
`alias` varchar(128) NOT NULL default '', `alias` varchar(128) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00', `created` datetime NOT NULL default '0000-00-00 00:00:00',
`last_login` datetime NOT NULL default '0000-00-00 00:00:00', `last_login` datetime NOT NULL default '0000-00-00 00:00:00',
`language` varchar(5) NOT NULL default 'en', `language` varchar(5),
`preferences` text, `preferences` text,
PRIMARY KEY (`user_id`), PRIMARY KEY (`user_id`),
INDEX `username_index` (`username`), INDEX `username_index` (`username`),
Expand Down
3 changes: 3 additions & 0 deletions SQL/mysql.update.sql
Expand Up @@ -41,3 +41,6 @@ ALTER TABLE `session`


ALTER TABLE `cache` ALTER TABLE `cache`
ADD INDEX `created_index` (`created`); ADD INDEX `created_index` (`created`);

ALTER TABLE `users`
CHANGE `language` `language` varchar(5);
2 changes: 1 addition & 1 deletion SQL/mysql5.initial.sql
Expand Up @@ -28,7 +28,7 @@ CREATE TABLE `users` (
`alias` varchar(128) NOT NULL, `alias` varchar(128) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`language` varchar(5) NOT NULL DEFAULT 'en', `language` varchar(5),
`preferences` text, `preferences` text,
PRIMARY KEY(`user_id`), PRIMARY KEY(`user_id`),
INDEX `username_index` (`username`), INDEX `username_index` (`username`),
Expand Down
2 changes: 1 addition & 1 deletion SQL/postgres.initial.sql
Expand Up @@ -21,7 +21,7 @@ CREATE TABLE users (
alias character varying(128) DEFAULT ''::character varying NOT NULL, alias character varying(128) DEFAULT ''::character varying NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL, created timestamp with time zone DEFAULT now() NOT NULL,
last_login timestamp with time zone DEFAULT now() NOT NULL, last_login timestamp with time zone DEFAULT now() NOT NULL,
"language" character varying(5) DEFAULT 'en'::character varying NOT NULL, "language" character varying(5),
preferences text DEFAULT ''::text NOT NULL preferences text DEFAULT ''::text NOT NULL
); );


Expand Down
3 changes: 3 additions & 0 deletions SQL/postgres.update.sql
Expand Up @@ -28,3 +28,6 @@ ALTER TABLE cache DROP session_id;


CREATE INDEX session_changed_idx ON session (changed); CREATE INDEX session_changed_idx ON session (changed);
CREATE INDEX cache_created_idx ON "cache" (created); CREATE INDEX cache_created_idx ON "cache" (created);

ALTER TABLE users ALTER "language" DROP NOT NULL;
ALTER TABLE users ALTER "language" DROP DEFAULT;
2 changes: 1 addition & 1 deletion SQL/sqlite.initial.sql
Expand Up @@ -76,7 +76,7 @@ CREATE TABLE users (
alias varchar(128) NOT NULL default '', alias varchar(128) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00', created datetime NOT NULL default '0000-00-00 00:00:00',
last_login datetime NOT NULL default '0000-00-00 00:00:00', last_login datetime NOT NULL default '0000-00-00 00:00:00',
language varchar(5) NOT NULL default 'en', language varchar(5),
preferences text NOT NULL default '' preferences text NOT NULL default ''
); );


Expand Down

0 comments on commit debdda0

Please sign in to comment.