You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mssql.initial.sql 1.7KB

12345678910111213141516171819202122232425262728293031323334
  1. CREATE TABLE [dbo].[collected_contacts] (
  2. [contact_id] [int] IDENTITY (1, 1) NOT NULL ,
  3. [user_id] [int] NOT NULL ,
  4. [changed] [datetime] NOT NULL ,
  5. [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
  6. [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
  7. [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL ,
  8. [firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
  9. [surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
  10. [vcard] [text] COLLATE Latin1_General_CI_AI NULL ,
  11. [words] [text] COLLATE Latin1_General_CI_AI NULL
  12. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
  13. GO
  14. ALTER TABLE [dbo].[collected_contacts] WITH NOCHECK ADD
  15. CONSTRAINT [PK_collected_contacts_contact_id] PRIMARY KEY CLUSTERED
  16. (
  17. [contact_id]
  18. ) ON [PRIMARY]
  19. GO
  20. ALTER TABLE [dbo].[collected_contacts] ADD
  21. CONSTRAINT [DF_collected_contacts_user_id] DEFAULT (0) FOR [user_id],
  22. CONSTRAINT [DF_collected_contacts_changed] DEFAULT (getdate()) FOR [changed],
  23. CONSTRAINT [DF_collected_contacts_del] DEFAULT ('0') FOR [del],
  24. CONSTRAINT [DF_collected_contacts_name] DEFAULT ('') FOR [name],
  25. CONSTRAINT [DF_collected_contacts_email] DEFAULT ('') FOR [email],
  26. CONSTRAINT [DF_collected_contacts_firstname] DEFAULT ('') FOR [firstname],
  27. CONSTRAINT [DF_collected_contacts_surname] DEFAULT ('') FOR [surname],
  28. CONSTRAINT [CK_collected_contacts_del] CHECK ([del] = '1' or [del] = '0')
  29. GO
  30. CREATE INDEX [IX_collected_contacts_user_id] ON [dbo].[collected_contacts]([user_id]) ON [PRIMARY]
  31. GO