CREATE TABLE [dbo].[google_contacts] (
	[contact_id] [int] IDENTITY (1, 1) NOT NULL ,
	[user_id] [int] NOT NULL ,
	[changed] [datetime] NOT NULL ,
	[del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
	[name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
	[email] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
	[firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
	[surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
	[vcard] [text] COLLATE Latin1_General_CI_AI NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[google_contacts] WITH NOCHECK ADD 
	CONSTRAINT [PK_google_contacts_contact_id] PRIMARY KEY  CLUSTERED 
	(
		[contact_id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[google_contacts] ADD 
	CONSTRAINT [DF_google_contacts_user_id] DEFAULT (0) FOR [user_id],
	CONSTRAINT [DF_google_contacts_changed] DEFAULT (getdate()) FOR [changed],
	CONSTRAINT [DF_google_contacts_del] DEFAULT ('0') FOR [del],
	CONSTRAINT [DF_google_contacts_name] DEFAULT ('') FOR [name],
	CONSTRAINT [DF_google_contacts_email] DEFAULT ('') FOR [email],
	CONSTRAINT [DF_google_contacts_firstname] DEFAULT ('') FOR [firstname],
	CONSTRAINT [DF_google_contacts_surname] DEFAULT ('') FOR [surname],
	CONSTRAINT [CK_google_contacts_del] CHECK ([del] = '1' or [del] = '0')
GO

 CREATE  INDEX [IX_google_contacts_user_id] ON [dbo].[google_contacts]([user_id]) ON [PRIMARY]
GO

