sql server - How do I create MS SQL tables for a fresh WordPress installation? -
i working on new wordpress site host online bookstore publishing company. .net developer rather use ms sql in combination wp db abstraction (https://wordpress.org/plugins/wordpress-database-abstraction/) plugin. did fresh install of brandoo wordpress (http://www.microsoft.com/web/gallery/brandoowordpressmssql.aspx) worked fine. when wanted create copies of database create instances of wordpress ran problems not of details relating tables structure, keys, constraints , default values not copied over.
what create table statements need create wordpress related tables in ms sql server?
for sql server 2012, following sql script creates needed tables wordpress 3.8.1.
use [wordpressdb] go /****** object: table [dbo].[wp_commentmeta] script date: 4/6/2014 5:35:46 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_commentmeta]( [meta_id] [bigint] identity(1,1) not null, [comment_id] [bigint] not null, [meta_key] [nvarchar](255) null, [meta_value] [nvarchar](max) null, constraint [wp_commentmeta_meta_id] primary key clustered ( [meta_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_commentmeta] add default ('0') [comment_id] go alter table [dbo].[wp_commentmeta] add default (null) [meta_key] go /****** object: table [dbo].[wp_comments] script date: 4/6/2014 5:37:04 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_comments]( [comment_id] [bigint] identity(1,1) not null, [comment_post_id] [bigint] not null, [comment_author] [nvarchar](max) not null, [comment_author_email] [nvarchar](100) not null, [comment_author_url] [nvarchar](200) not null, [comment_author_ip] [nvarchar](100) not null, [comment_date] [datetime] not null, [comment_date_gmt] [datetime] not null, [comment_content] [nvarchar](max) not null, [comment_karma] [int] not null, [comment_approved] [nvarchar](20) not null, [comment_agent] [nvarchar](255) not null, [comment_type] [nvarchar](20) not null, [comment_parent] [bigint] not null, [user_id] [bigint] not null, constraint [wp_comments_comment_id] primary key clustered ( [comment_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_comments] add default ('0') [comment_post_id] go alter table [dbo].[wp_comments] add default ('') [comment_author_email] go alter table [dbo].[wp_comments] add default ('') [comment_author_url] go alter table [dbo].[wp_comments] add default ('') [comment_author_ip] go alter table [dbo].[wp_comments] add default (getdate()) [comment_date] go alter table [dbo].[wp_comments] add default (getdate()) [comment_date_gmt] go alter table [dbo].[wp_comments] add default ('0') [comment_karma] go alter table [dbo].[wp_comments] add default ('1') [comment_approved] go alter table [dbo].[wp_comments] add default ('') [comment_agent] go alter table [dbo].[wp_comments] add default ('') [comment_type] go alter table [dbo].[wp_comments] add default ('0') [comment_parent] go alter table [dbo].[wp_comments] add default ('0') [user_id] go /****** object: table [dbo].[wp_links] script date: 4/6/2014 5:37:25 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_links]( [link_id] [bigint] identity(1,1) not null, [link_url] [nvarchar](255) not null, [link_name] [nvarchar](255) not null, [link_image] [nvarchar](255) not null, [link_target] [nvarchar](25) not null, [link_description] [nvarchar](255) not null, [link_visible] [nvarchar](20) not null, [link_owner] [bigint] not null, [link_rating] [int] not null, [link_updated] [datetime] not null, [link_rel] [nvarchar](255) not null, [link_notes] [nvarchar](max) not null, [link_rss] [nvarchar](255) not null, constraint [wp_links_link_id] primary key clustered ( [link_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_links] add default ('') [link_url] go alter table [dbo].[wp_links] add default ('') [link_name] go alter table [dbo].[wp_links] add default ('') [link_image] go alter table [dbo].[wp_links] add default ('') [link_target] go alter table [dbo].[wp_links] add default ('') [link_description] go alter table [dbo].[wp_links] add default ('y') [link_visible] go alter table [dbo].[wp_links] add default ('1') [link_owner] go alter table [dbo].[wp_links] add default ('0') [link_rating] go alter table [dbo].[wp_links] add default (getdate()) [link_updated] go alter table [dbo].[wp_links] add default ('') [link_rel] go alter table [dbo].[wp_links] add default ('') [link_rss] go /****** object: table [dbo].[wp_options] script date: 4/6/2014 5:38:02 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_options]( [option_id] [bigint] identity(1,1) not null, [option_name] [nvarchar](64) not null, [option_value] [nvarchar](max) not null, [autoload] [nvarchar](20) not null, constraint [wp_options_option_id] primary key clustered ( [option_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary], constraint [wp_options_option_name] unique nonclustered ( [option_name] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_options] add default ('') [option_name] go alter table [dbo].[wp_options] add default ('yes') [autoload] go /****** object: table [dbo].[wp_postmeta] script date: 4/6/2014 5:38:19 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_postmeta]( [meta_id] [bigint] identity(1,1) not null, [post_id] [bigint] not null, [meta_key] [nvarchar](255) null, [meta_value] [nvarchar](max) null, constraint [wp_postmeta_meta_id] primary key clustered ( [meta_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_postmeta] add default ('0') [post_id] go alter table [dbo].[wp_postmeta] add default (null) [meta_key] go /****** object: table [dbo].[wp_posts] script date: 4/6/2014 5:38:37 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_posts]( [id] [bigint] identity(1,1) not null, [post_author] [bigint] not null, [post_date] [datetime] not null, [post_date_gmt] [datetime] not null, [post_content] [nvarchar](max) not null, [post_title] [nvarchar](max) not null, [post_excerpt] [nvarchar](max) not null, [post_status] [nvarchar](20) not null, [comment_status] [nvarchar](20) not null, [ping_status] [nvarchar](20) not null, [post_password] [nvarchar](20) not null, [post_name] [nvarchar](200) not null, [to_ping] [nvarchar](max) not null, [pinged] [nvarchar](max) not null, [post_modified] [datetime] not null, [post_modified_gmt] [datetime] not null, [post_content_filtered] [nvarchar](max) not null, [post_parent] [bigint] not null, [guid] [nvarchar](255) not null, [menu_order] [int] not null, [post_type] [nvarchar](20) not null, [post_mime_type] [nvarchar](100) not null, [comment_count] [bigint] not null, constraint [wp_posts_id] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_posts] add default ('0') [post_author] go alter table [dbo].[wp_posts] add default (getdate()) [post_date] go alter table [dbo].[wp_posts] add default (getdate()) [post_date_gmt] go alter table [dbo].[wp_posts] add default ('publish') [post_status] go alter table [dbo].[wp_posts] add default ('open') [comment_status] go alter table [dbo].[wp_posts] add default ('open') [ping_status] go alter table [dbo].[wp_posts] add default ('') [post_password] go alter table [dbo].[wp_posts] add default ('') [post_name] go alter table [dbo].[wp_posts] add default (getdate()) [post_modified] go alter table [dbo].[wp_posts] add default (getdate()) [post_modified_gmt] go alter table [dbo].[wp_posts] add default ('0') [post_parent] go alter table [dbo].[wp_posts] add default ('') [guid] go alter table [dbo].[wp_posts] add default ('0') [menu_order] go alter table [dbo].[wp_posts] add default ('post') [post_type] go alter table [dbo].[wp_posts] add default ('') [post_mime_type] go alter table [dbo].[wp_posts] add default ('0') [comment_count] go /****** object: table [dbo].[wp_term_relationships] script date: 4/6/2014 5:38:54 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_term_relationships]( [object_id] [bigint] not null, [term_taxonomy_id] [bigint] not null, [term_order] [int] not null, constraint [wp_term_relationships_object_id_term_taxonomy_id] primary key clustered ( [object_id] asc, [term_taxonomy_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] go alter table [dbo].[wp_term_relationships] add default ((0)) [object_id] go alter table [dbo].[wp_term_relationships] add default ((0)) [term_taxonomy_id] go alter table [dbo].[wp_term_relationships] add default ((0)) [term_order] go /****** object: table [dbo].[wp_term_taxonomy] script date: 4/6/2014 5:39:09 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_term_taxonomy]( [term_taxonomy_id] [bigint] identity(1,1) not null, [term_id] [bigint] not null, [taxonomy] [nvarchar](32) not null, [description] [nvarchar](max) not null, [parent] [bigint] not null, [count] [bigint] not null, constraint [wp_term_taxonomy_term_taxonomy_id] primary key clustered ( [term_taxonomy_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_term_taxonomy] add default ((0)) [term_id] go alter table [dbo].[wp_term_taxonomy] add default ('') [taxonomy] go alter table [dbo].[wp_term_taxonomy] add default ((0)) [parent] go alter table [dbo].[wp_term_taxonomy] add default ((0)) [count] go /****** object: table [dbo].[wp_terms] script date: 4/6/2014 5:39:27 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_terms]( [term_id] [bigint] identity(1,1) not null, [name] [nvarchar](200) not null, [slug] [nvarchar](200) not null, [term_group] [bigint] not null, constraint [wp_terms_term_id] primary key clustered ( [term_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] go alter table [dbo].[wp_terms] add default ('') [name] go alter table [dbo].[wp_terms] add default ('') [slug] go alter table [dbo].[wp_terms] add default ((0)) [term_group] go /****** object: table [dbo].[wp_usermeta] script date: 4/6/2014 5:39:41 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_usermeta]( [umeta_id] [bigint] identity(1,1) not null, [user_id] [bigint] not null, [meta_key] [nvarchar](255) null, [meta_value] [nvarchar](max) null, constraint [wp_usermeta_umeta_id] primary key clustered ( [umeta_id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] textimage_on [primary] go alter table [dbo].[wp_usermeta] add default ('0') [user_id] go alter table [dbo].[wp_usermeta] add default (null) [meta_key] go /****** object: table [dbo].[wp_users] script date: 4/6/2014 5:39:57 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[wp_users]( [id] [bigint] identity(1,1) not null, [user_login] [nvarchar](60) not null, [user_pass] [nvarchar](64) not null, [user_nicename] [nvarchar](50) not null, [user_email] [nvarchar](100) not null, [user_url] [nvarchar](100) not null, [user_registered] [datetime] not null, [user_activation_key] [nvarchar](60) not null, [user_status] [int] not null, [display_name] [nvarchar](250) not null, constraint [wp_users_id] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] go alter table [dbo].[wp_users] add default ('') [user_login] go alter table [dbo].[wp_users] add default ('') [user_pass] go alter table [dbo].[wp_users] add default ('') [user_nicename] go alter table [dbo].[wp_users] add default ('') [user_email] go alter table [dbo].[wp_users] add default ('') [user_url] go alter table [dbo].[wp_users] add default (getdate()) [user_registered] go alter table [dbo].[wp_users] add default ('') [user_activation_key] go alter table [dbo].[wp_users] add default ('0') [user_status] go alter table [dbo].[wp_users] add default ('') [display_name] go
Comments
Post a Comment