Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[com_fields] MSSQL - sql for Custom fields #12660

Merged
merged 21 commits into from
Jan 7, 2017
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/****** Object:  Table [#__fields] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields](
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[group_id] [int] NOT NULL DEFAULT 0,
[assigned_cat_ids] [nvarchar](255) NOT NULL DEFAULT '',
[title] [nvarchar](255) NOT NULL DEFAULT '',
[alias] [nvarchar](255) NOT NULL DEFAULT '',
[label] [nvarchar](255) NOT NULL DEFAULT '',
[default_value] [nvarchar](max) NOT NULL DEFAULT '',
[type] [nvarchar](255) NOT NULL DEFAULT '',
[options] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL DEFAULT '',
[state] [smallint] NOT NULL DEFAULT 0,
[required] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[params] [nvarchar](max) NOT NULL DEFAULT '',
[fieldparams] [nvarchar](max) NOT NULL DEFAULT '',
[attributes] [nvarchar](max) NOT NULL DEFAULT '',
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_user_id] [bigint] NOT NULL DEFAULT 0,
[created_by_alias] [nvarchar](255) NOT NULL DEFAULT '',
[modified_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[publish_up] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[publish_down] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_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];

CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

/****** Object: Table [#__fields_groups] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields_groups](
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[extension] [nvarchar](255) NOT NULL DEFAULT '',
[title] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL DEFAULT '',
[state] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_by] [bigint] NOT NULL DEFAULT 0,
[modified] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_groups_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];

CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields_groups](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields_groups](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_created_by] ON [#__fields_groups](
[created_by] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields_groups](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_extension] ON [#__fields_groups](
[extension] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields_groups](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

/****** Object:  Table [#__fields_values] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields_values](
[field_id] [bigint] NOT NULL DEFAULT 1,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[item_id] [nvarchar](255) NOT NULL DEFAULT '',
[value] [nvarchar](max) NOT NULL DEFAULT '',
) ON [PRIMARY];

CREATE NONCLUSTERED INDEX [idx_field_id] ON [#__fields_values](
[field_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields_values](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_item_id] ON [#__fields_values](
[item_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

SET IDENTITY_INSERT [#__extensions] ON;

INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

SET IDENTITY_INSERT [#__extensions] OFF;
143 changes: 141 additions & 2 deletions installation/sql/sqlazure/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,9 @@ SELECT 30, 'com_contenthistory', 'component', 'com_contenthistory', '', 1, 1, 1,
UNION ALL
SELECT 31, 'com_ajax', 'component', 'com_ajax', '', 1, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 32, 'com_postinstall', 'component', 'com_postinstall', '', 1, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;
SELECT 32, 'com_postinstall', 'component', 'com_postinstall', '', 1, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

-- Libraries
INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
Expand Down Expand Up @@ -1016,7 +1018,11 @@ SELECT 458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quick
UNION ALL
SELECT 459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 460, 'plg_editors-xtd_contact', 'plugin', 'contact', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;
SELECT 460, 'plg_editors-xtd_contact', 'plugin', 'contact', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;

-- Templates
INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
Expand Down Expand Up @@ -1044,6 +1050,139 @@ SELECT 802, 'English (en-GB) Language Pack', 'package', 'pkg_en-GB', '', 0, 1, 1

SET IDENTITY_INSERT [#__extensions] OFF;

/****** Object:  Table [#__fields] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields](
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[group_id] [int] NOT NULL DEFAULT 0,
[assigned_cat_ids] [nvarchar](255) NOT NULL DEFAULT '',
[title] [nvarchar](255) NOT NULL DEFAULT '',
[alias] [nvarchar](255) NOT NULL DEFAULT '',
[label] [nvarchar](255) NOT NULL DEFAULT '',
[default_value] [nvarchar](max) NOT NULL,
[type] [nvarchar](255) NOT NULL DEFAULT '',
[options] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL,
[state] [smallint] NOT NULL DEFAULT 0,
[required] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[params] [nvarchar](max) NOT NULL,
[fieldparams] [nvarchar](max) NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is from #12642 (comment)
Cannot insert the value NULL into column 'fieldparams', table 'joomla.dbo.#__fields'; column does not allow nulls.

[attributes] [nvarchar](max) NOT NULL,
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_user_id] [bigint] NOT NULL DEFAULT 0,
[created_by_alias] [nvarchar](255) NOT NULL DEFAULT '',
[modified_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[publish_up] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[publish_down] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_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];

CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

/****** Object: Table [#__fields_groups] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields_groups](
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[extension] [nvarchar](255) NOT NULL DEFAULT '',
[title] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL DEFAULT '',
[state] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_by] [bigint] NOT NULL DEFAULT 0,
[modified] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_groups_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];

CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields_groups](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields_groups](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_created_by] ON [#__fields_groups](
[created_by] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields_groups](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_extension] ON [#__fields_groups](
[extension] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields_groups](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

/****** Object:  Table [#__fields_values] ******/

SET QUOTED_IDENTIFIER ON;

CREATE TABLE [#__fields_values](
[field_id] [bigint] NOT NULL DEFAULT 1,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[item_id] [nvarchar](255) NOT NULL DEFAULT '',
[value] [nvarchar](max) NOT NULL DEFAULT '',
) ON [PRIMARY];

CREATE NONCLUSTERED INDEX [idx_field_id] ON [#__fields_values](
[field_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields_values](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

CREATE NONCLUSTERED INDEX [idx_item_id] ON [#__fields_values](
[item_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);

/****** Object: Table [#__finder_filters] ******/
SET QUOTED_IDENTIFIER ON;

Expand Down