How to upgrade active objects columns from varchar to nvarchar in SQL Server

Still need help?

The Atlassian Community is here for you.

Ask the community

This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.

Purpose

In Confluence 5.8 the Active Objects library was changed to use the nvarchar type for new columns. However when upgrading from Confluence 5.7 or earlier, existing active objects tables are not upgraded from varchar to nvarchar. See  CONF-38232 - Getting issue details... STATUS  for more details. 

Solution

This has been fixed as an upgrade task in Confluence 5.9, but customers who want to upgrade from Confluence 5.7 to Confluence 5.8 can use the scripts provided below to manually upgrade all affected Active Objects tables. 

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

The upgrade sequence is:

  1. Shut down Confluence 5.7 
  2. Back up your database
  3. Generate queries using the scripts below for:
    1. foreign keys to drop and recreate
    2. primary keys to drop and recreate
    3. unique indexes to drop and recreate
    4. non unique indexes to drop and recreate
    5. altering columns from varchar to nvarchar
  4. Run the scripts you created in the below order (you can either run the .sql scripts, or copy the queries in them back into SQL Server Management Studio, whichever you find more convenient)
    1. Execute 1-dropfks.sql - drop foreign key constraints

    2. Execute 2-droppks.sql - drop primary key constraints

    3. Execute 3-dropuniqueidx.sql - drop unique indexes

    4. Execute 4-dropnonuniqueidx.sql - drop non-unique indexes

    5. Execute 5-altercolumntype.sql - alter data type for all varchar columns in Active Objects tables

    6. Execute 6-addnonuniqueidx.sql - recreate non-unique indexes 

    7. Execute 7-adduniqueidx.sql - recreate unique indexes

    8. Execute 8-addpks.sql - recreate primary keys constraints

    9. Execute 9-addfks.sql - recreate foreign keys

  5. Back up your database again, in case you need to roll back to this point during the upgrade
  6. Upgrade to Confluence 5.8 in the usual way

Foreign keys scripts generation

DROP/CREATE foreign keys
-- copy the first column of the results to a file called '1-dropfks.sql'
-- copy the second column of the results to a file called '9-addfks.sql'
 
SELECT  
'ALTER TABLE ' + tab1.name + ' DROP CONSTRAINT ' + obj.name + ';', 
'ALTER TABLE ' + tab1.name + ' ADD CONSTRAINT ' + obj.name + ' FOREIGN KEY ' + '('+ col1.name + ')' + ' references ' + tab2.name + '(' + col2.name + ');',
    obj.name AS FK_NAME,
    sch.name AS [schema_name],
    tab1.name AS [table],
    col1.name AS [column],
    tab2.name AS [referenced_table],
    col2.name AS [referenced_column]
FROM sys.foreign_key_columns fkc
INNER JOIN sys.objects obj
    ON obj.object_id = fkc.constraint_object_id
INNER JOIN sys.tables tab1
    ON tab1.object_id = fkc.parent_object_id
INNER JOIN sys.schemas sch
    ON tab1.schema_id = sch.schema_id
INNER JOIN sys.columns col1
    ON col1.column_id = parent_column_id AND col1.object_id = tab1.object_id
INNER JOIN sys.tables tab2
    ON tab2.object_id = fkc.referenced_object_id
INNER JOIN sys.columns col2
    ON col2.column_id = referenced_column_id AND col2.object_id = tab2.object_id
WHERE tab1.name like 'AO_%';

 

Primary keys

DROP/CREATE primary keys
-- copy the first column of the results to a file called '2-droppks.sql'
-- copy the second column of the results to a file called '8-addpks.sql'
 
SELECT 
  'ALTER TABLE ' + '"' + T.Name + '"'  + ' DROP CONSTRAINT ' + '"' + I.Name + '";',
  'ALTER TABLE ' + T.Name + ' ADD PRIMARY KEY (' + C.Name + ');'    
FROM sys.indexes I 
 INNER JOIN sys.index_columns IC 
  ON  I.object_id = IC.object_id AND I.index_id = IC.index_id 
 INNER JOIN sys.columns C 
  ON IC.object_id = C.object_id and IC.column_id = C.column_id 
 INNER JOIN sys.tables T 
  ON I.object_id = T.object_id 
 INNER JOIN sys.types ST 
  ON ST.system_type_id = C.system_type_id -- join on system type to create not null on nvarchar primary keys
  WHERE I.is_primary_key = 1 
  and T.Name like 'AO_%'
  and ST.name = 'varchar'
  ORDER BY T.Name, I.Name;

 

Unique indexes

DROP/CREATE unique indexes
-- copy the first column of the results to a file called '3-dropuniqueidx.sql'
-- copy the second column of the results to a file called '7-adduniqueidx.sql'
 
SELECT 
'ALTER TABLE ' + '"' + T.Name + '"'  + ' DROP CONSTRAINT ' + '"' + I.Name + '";',
'CREATE UNIQUE '  
+ cast (I.type_desc as varchar(512)) collate SQL_Latin1_General_CP1_CI_AS
+ ' INDEX ' + I.Name + ' ON ' + '"' + T.Name + '"' + '(' + '"' +C.Name+'"' + ');' 
FROM sys.indexes I 
 INNER JOIN sys.index_columns IC 
  ON  I.object_id = IC.object_id AND I.index_id = IC.index_id 
 INNER JOIN sys.columns C 
  ON IC.object_id = C.object_id and IC.column_id = C.column_id 
 INNER JOIN sys.tables T 
  ON I.object_id = T.object_id 
  WHERE T.Name like 'AO_%'
  and I.is_primary_key = 0 
  and I.is_unique = 'true'
ORDER BY T.Name, I.Name;

 

Non unique indexes

DROP/CREATE non unique keys
-- copy the first column of the results to a file called '4-dropnonuniqueidx.sql'
-- copy the second column of the results to a file called '6-addnonuniqueidx.sql'
 
SELECT 
'DROP INDEX ' + '"' + T.Name + '"' + '.' + '"' + I.Name + '";',
'CREATE '  
+ cast (I.type_desc as varchar(512)) collate SQL_Latin1_General_CP1_CI_AS
+ ' INDEX ' + I.Name + ' ON ' + '"' + T.Name + '"' + '(' + '"' +C.Name+'"' + ');' 
FROM sys.indexes I 
 INNER JOIN sys.index_columns IC 
  ON  I.object_id = IC.object_id AND I.index_id = IC.index_id 
 INNER JOIN sys.columns C 
  ON IC.object_id = C.object_id and IC.column_id = C.column_id 
 INNER JOIN sys.tables T 
  ON I.object_id = T.object_id 
  WHERE T.Name like 'AO_%'
  and I.is_primary_key = 0 
  and I.is_unique = 'false'
ORDER BY T.Name, I.Name;

 

Alter the column type

Alter Column Types
-- copy the results to a file called '5-altercolumntype.sql'
 
SELECT 'ALTER TABLE ' + syo.name + ' ALTER COLUMN ' + '"' + syc.name + '"' + ' nvarchar' + 
'(' + 
  CASE
    WHEN COL_LENGTH ( syo.name , syc.name ) <> -1 THEN 
      CONVERT(varchar(10), COL_LENGTH ( syo.name , syc.name ))
      ELSE 'max' -- -1
  END +
')' + 
CASE 
  WHEN COLUMNPROPERTY(OBJECT_ID(syo.name),syc.name,'AllowsNull') = 1
    THEN ' NULL'
    ELSE ' NOT NULL'
END + ';'
FROM sysobjects syo
   JOIN syscolumns syc ON
     syc.id = syo.id
   JOIN systypes syt ON
     syt.xtype = syc.xtype
   WHERE syt.name = 'varchar'
   and syo.name like 'AO_%'
   ORDER by syo.name, syc.name;

 

Example output

This is an example of output of these blocks, ordered by description.

See example output...
--Removal of foreign keys
ALTER TABLE AO_7CDE43_SERVER_PARAM DROP CONSTRAINT fk_ao_7cde43_server_param_server_config_id;
ALTER TABLE AO_7CDE43_NOTIFICATION DROP CONSTRAINT fk_ao_7cde43_notification_notification_scheme_id;
ALTER TABLE AO_7CDE43_EVENT DROP CONSTRAINT fk_ao_7cde43_event_notification_id;
ALTER TABLE AO_7CDE43_RECIPIENT DROP CONSTRAINT fk_ao_7cde43_recipient_notification_id;
ALTER TABLE AO_7CDE43_FILTER_PARAM DROP CONSTRAINT fk_ao_7cde43_filter_param_notification_id;
ALTER TABLE AO_5FB9D7_AOHIP_CHAT_USER DROP CONSTRAINT fk_ao_5fb9d7_aohip_chat_user_hip_chat_link_id;
ALTER TABLE AO_9412A1_USER_APP_LINK DROP CONSTRAINT fk_ao_9412a1_user_app_link_user_id;
ALTER TABLE AO_950DC3_TC_SUBCALS DROP CONSTRAINT fk_ao_950dc3_tc_subcals_parent_id;
ALTER TABLE AO_950DC3_TC_SUBCALS DROP CONSTRAINT fk_ao_950dc3_tc_subcals_subscription_id;
ALTER TABLE AO_950DC3_TC_SUBCALS_PRIV_USR DROP CONSTRAINT fk_ao_950dc3_tc_subcals_priv_usr_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_SUBCALS_PRIV_GRP DROP CONSTRAINT fk_ao_950dc3_tc_subcals_priv_grp_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_SUBCALS_PROPS DROP CONSTRAINT fk_ao_950dc3_tc_subcals_props_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_EVENTS DROP CONSTRAINT fk_ao_950dc3_tc_events_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_DISABLE_EV_TYPES DROP CONSTRAINT fk_ao_950dc3_tc_disable_ev_types_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_CUSTOM_EV_TYPES DROP CONSTRAINT fk_ao_950dc3_tc_custom_ev_types_belong_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_REMINDER_USERS DROP CONSTRAINT fk_ao_950dc3_tc_reminder_users_sub_calendar_id;
ALTER TABLE AO_950DC3_TC_EVENTS DROP CONSTRAINT fk_ao_950dc3_tc_events_reminder_setting_id;
ALTER TABLE AO_950DC3_TC_EVENTS_INVITEES DROP CONSTRAINT fk_ao_950dc3_tc_events_invitees_event_id;
ALTER TABLE AO_950DC3_TC_EVENTS_EXCL DROP CONSTRAINT fk_ao_950dc3_tc_events_excl_event_id;
ALTER TABLE AO_54C900_C_TEMPLATE_REF DROP CONSTRAINT fk_ao_54c900_c_template_ref_cb_parentid;
ALTER TABLE AO_54C900_C_TEMPLATE_REF DROP CONSTRAINT fk_ao_54c900_c_template_ref_cb_index_parentid;
ALTER TABLE AO_54C900_C_TEMPLATE_REF DROP CONSTRAINT fk_ao_54c900_c_template_ref_parent_id;
ALTER TABLE AO_54C900_SPACE_BLUEPRINT_AO DROP CONSTRAINT fk_ao_54c900_space_blueprint_ao_home_page_id;
 
--Removal of primary keys
ALTER TABLE "AO_9412A1_AOREGISTRATION" DROP CONSTRAINT "pk_AO_9412A1_AOREGISTRATION_ID";
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" DROP CONSTRAINT "pk_AO_950DC3_TC_CUSTOM_EV_TYPES_ID";
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" DROP CONSTRAINT "pk_AO_950DC3_TC_REMINDER_SETTINGS_ID";
ALTER TABLE "AO_950DC3_TC_SUBCALS" DROP CONSTRAINT "pk_AO_950DC3_TC_SUBCALS_ID";
 
--Removal of unique indexes
ALTER TABLE "AO_9412A1_AOUSER" DROP CONSTRAINT "U_AO_9412A1_AOUSER_USERNAME";
 
--Removal of non unique indexes
DROP INDEX "AO_26DB7F_ENTITIES_TO_ROOMS"."index_ao_26db7f_ent831223480";
DROP INDEX "AO_26DB7F_ENTITIES_TO_ROOMS"."index_ao_26db7f_ent940053222";
DROP INDEX "AO_38321B_CUSTOM_CONTENT_LINK"."index_ao_38321b_cus1828044926";
DROP INDEX "AO_54C900_C_TEMPLATE_REF"."index_ao_54c900_c_t667820477";
DROP INDEX "AO_54C900_C_TEMPLATE_REF"."index_ao_54c900_c_t757546442";
DROP INDEX "AO_54C900_C_TEMPLATE_REF"."index_ao_54c900_c_t852152353";
DROP INDEX "AO_54C900_SPACE_BLUEPRINT_AO"."index_ao_54c900_spa357134289";
DROP INDEX "AO_5FB9D7_AOHIP_CHAT_USER"."index_ao_5fb9d7_aoh1981563178";
DROP INDEX "AO_5FB9D7_AOHIP_CHAT_USER"."index_ao_5fb9d7_aoh49772492";
DROP INDEX "AO_7CDE43_EVENT"."index_ao_7cde43_eve1433596955";
DROP INDEX "AO_7CDE43_FILTER_PARAM"."index_ao_7cde43_fil1140550715";
DROP INDEX "AO_7CDE43_NOTIFICATION"."index_ao_7cde43_not7362182";
DROP INDEX "AO_7CDE43_RECIPIENT"."index_ao_7cde43_rec1271577318";
DROP INDEX "AO_7CDE43_SERVER_PARAM"."index_ao_7cde43_ser828034299";
DROP INDEX "AO_92296B_AORECENTLY_VIEWED"."index_ao_92296b_aor1216492770";
DROP INDEX "AO_92296B_AORECENTLY_VIEWED"."index_ao_92296b_aor1615591099";
DROP INDEX "AO_92296B_AORECENTLY_VIEWED"."index_ao_92296b_aor205355936";
DROP INDEX "AO_92296B_AORECENTLY_VIEWED"."index_ao_92296b_aor426054036";
DROP INDEX "AO_92296B_AORECENTLY_VIEWED"."index_ao_92296b_aor818798913";
DROP INDEX "AO_9412A1_AONOTIFICATION"."index_ao_9412a1_aon1547032463";
DROP INDEX "AO_9412A1_AONOTIFICATION"."index_ao_9412a1_aon648423710";
DROP INDEX "AO_9412A1_AONOTIFICATION"."index_ao_9412a1_aon849931648";
DROP INDEX "AO_9412A1_AOTASK"."index_ao_9412a1_aot1465568358";
DROP INDEX "AO_9412A1_AOTASK"."index_ao_9412a1_aotask_user";
DROP INDEX "AO_9412A1_USER_APP_LINK"."index_ao_9412a1_use1222319987";
DROP INDEX "AO_9412A1_USER_APP_LINK"."index_ao_9412a1_use643533071";
DROP INDEX "AO_950DC3_TC_CUSTOM_EV_TYPES"."index_ao_950dc3_tc_1437233256";
DROP INDEX "AO_950DC3_TC_DISABLE_EV_TYPES"."index_ao_950dc3_tc_1806144629";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_1286773626";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_1526147574";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_1709841361";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_363043564";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_38648977";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_851944294";
DROP INDEX "AO_950DC3_TC_EVENTS"."index_ao_950dc3_tc_events_end";
DROP INDEX "AO_950DC3_TC_EVENTS_EXCL"."index_ao_950dc3_tc_1977525806";
DROP INDEX "AO_950DC3_TC_EVENTS_INVITEES"."index_ao_950dc3_tc_100715625";
DROP INDEX "AO_950DC3_TC_REMINDER_SETTINGS"."index_ao_950dc3_tc_1684546011";
DROP INDEX "AO_950DC3_TC_REMINDER_SETTINGS"."index_ao_950dc3_tc_1886631335";
DROP INDEX "AO_950DC3_TC_REMINDER_SETTINGS"."index_ao_950dc3_tc_2073603249";
DROP INDEX "AO_950DC3_TC_REMINDER_SETTINGS"."index_ao_950dc3_tc_786531555";
DROP INDEX "AO_950DC3_TC_REMINDER_USERS"."index_ao_950dc3_tc_122365134";
DROP INDEX "AO_950DC3_TC_SUBCALS"."index_ao_950dc3_tc_2091184233";
DROP INDEX "AO_950DC3_TC_SUBCALS"."index_ao_950dc3_tc_554676722";
DROP INDEX "AO_950DC3_TC_SUBCALS"."index_ao_950dc3_tc_836865362";
DROP INDEX "AO_950DC3_TC_SUBCALS"."index_ao_950dc3_tc_932705473";
DROP INDEX "AO_950DC3_TC_SUBCALS_PRIV_GRP"."index_ao_950dc3_tc_1891203755";
DROP INDEX "AO_950DC3_TC_SUBCALS_PRIV_GRP"."index_ao_950dc3_tc_525483330";
DROP INDEX "AO_950DC3_TC_SUBCALS_PRIV_USR"."index_ao_950dc3_tc_1978066438";
DROP INDEX "AO_950DC3_TC_SUBCALS_PRIV_USR"."index_ao_950dc3_tc_997641231";
DROP INDEX "AO_950DC3_TC_SUBCALS_PROPS"."index_ao_950dc3_tc_1847876863";
DROP INDEX "AO_950DC3_TC_SUBCALS_PROPS"."index_ao_950dc3_tc_1861854175";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi1066945234";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi1143751131";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi1389674752";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi1395974671";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi1978441610";
DROP INDEX "AO_BAF3AA_AOINLINE_TASK"."index_ao_baf3aa_aoi866493194";
DROP INDEX "AO_DC98AE_AOHELP_TIP"."index_ao_dc98ae_aoh1533992358";
DROP INDEX "AO_DC98AE_AOHELP_TIP"."index_ao_dc98ae_aoh411805038";
 
--Altering column data type 
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "CATEGORY" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "CUSTOM_ICON_CLASS" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "CUSTOM_TITLE" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "HARDCODED_URL" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "SPACE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "TYPE" nvarchar(255) NULL;
ALTER TABLE "AO_187CCC_SIDEBAR_LINK" ALTER COLUMN "WEB_ITEM_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_21D670_WHITELIST_RULES" ALTER COLUMN "TYPE" nvarchar(255) NOT NULL;
ALTER TABLE "AO_26DB7F_ENTITIES_TO_ROOMS" ALTER COLUMN "ENTITY_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_26DB7F_ENTITIES_TO_ROOMS" ALTER COLUMN "MESSAGE_TYPE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_26DB7F_ENTITIES_TO_ROOMS" ALTER COLUMN "ROOM_ID" nvarchar(255) NULL;
ALTER TABLE "AO_38321B_CUSTOM_CONTENT_LINK" ALTER COLUMN "CONTENT_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_38321B_CUSTOM_CONTENT_LINK" ALTER COLUMN "LINK_LABEL" nvarchar(255) NULL;
ALTER TABLE "AO_38321B_CUSTOM_CONTENT_LINK" ALTER COLUMN "LINK_URL" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_C_TEMPLATE_REF" ALTER COLUMN "NAME" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_C_TEMPLATE_REF" ALTER COLUMN "PLUGIN_MODULE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_C_TEMPLATE_REF" ALTER COLUMN "UUID" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "CREATE_RESULT" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "HOW_TO_USE_TEMPLATE" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "INDEX_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "INDEX_TITLE_I18N_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "NAME" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "PLUGIN_MODULE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "SPACE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_CONTENT_BLUEPRINT_AO" ALTER COLUMN "UUID" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_SPACE_BLUEPRINT_AO" ALTER COLUMN "CATEGORY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_SPACE_BLUEPRINT_AO" ALTER COLUMN "NAME" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_SPACE_BLUEPRINT_AO" ALTER COLUMN "PLUGIN_MODULE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_54C900_SPACE_BLUEPRINT_AO" ALTER COLUMN "UUID" nvarchar(255) NULL;
ALTER TABLE "AO_5F3884_FEATURE_DISCOVERY" ALTER COLUMN "USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "API_URL" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "GROUP_NAME" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "OAUTH_ID" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "SECRET_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "SYSTEM_PASSWORD" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "SYSTEM_USER" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "SYSTEM_USER_TOKEN" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_LINK" ALTER COLUMN "TOKEN" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_USER" ALTER COLUMN "HIP_CHAT_USER_ID" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_USER" ALTER COLUMN "REFRESH_CODE" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_USER" ALTER COLUMN "USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_5FB9D7_AOHIP_CHAT_USER" ALTER COLUMN "USER_TOKEN" nvarchar(255) NULL;
ALTER TABLE "AO_6384AB_DISCOVERED" ALTER COLUMN "KEY" nvarchar(255) NULL;
ALTER TABLE "AO_6384AB_DISCOVERED" ALTER COLUMN "PLUGIN_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_6384AB_DISCOVERED" ALTER COLUMN "USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_6384AB_FEATURE_METADATA_AO" ALTER COLUMN "CONTEXT" nvarchar(255) NULL;
ALTER TABLE "AO_6384AB_FEATURE_METADATA_AO" ALTER COLUMN "KEY" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_EVENT" ALTER COLUMN "EVENT_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_FILTER_PARAM" ALTER COLUMN "PARAM_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_NOTIFICATION_SCHEME" ALTER COLUMN "SCHEME_NAME" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_RECIPIENT" ALTER COLUMN "TYPE" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_SERVER_CONFIG" ALTER COLUMN "DEFAULT_USER_ID_TEMPLATE" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_SERVER_CONFIG" ALTER COLUMN "NOTIFICATION_MEDIUM_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_SERVER_CONFIG" ALTER COLUMN "SERVER_NAME" nvarchar(255) NULL;
ALTER TABLE "AO_7CDE43_SERVER_PARAM" ALTER COLUMN "PARAM_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_92296B_AORECENTLY_VIEWED" ALTER COLUMN "CONTENT_TYPE" nvarchar(255) NULL;
ALTER TABLE "AO_92296B_AORECENTLY_VIEWED" ALTER COLUMN "SPACE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_92296B_AORECENTLY_VIEWED" ALTER COLUMN "USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "ACTION" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "APPLICATION" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "APPLICATION_LINK_ID" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "ENTITY" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "GLOBAL_ID" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "GROUPING_ID" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "STATUS" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AONOTIFICATION" ALTER COLUMN "USER" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOREGISTRATION" ALTER COLUMN "ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "APPLICATION" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "APPLICATION_LINK_ID" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "ENTITY" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "GLOBAL_ID" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "STATUS" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOTASK" ALTER COLUMN "USER" nvarchar(255) NULL;
ALTER TABLE "AO_9412A1_AOUSER" ALTER COLUMN "USERNAME" nvarchar(255) NOT NULL;
ALTER TABLE "AO_9412A1_USER_APP_LINK" ALTER COLUMN "APPLICATION_LINK_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" ALTER COLUMN "BELONG_SUB_CALENDAR_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" ALTER COLUMN "CREATED" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" ALTER COLUMN "ICON" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" ALTER COLUMN "ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_CUSTOM_EV_TYPES" ALTER COLUMN "TITLE" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_DISABLE_EV_TYPES" ALTER COLUMN "EVENT_KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_DISABLE_EV_TYPES" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS" ALTER COLUMN "ORGANISER" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS" ALTER COLUMN "RECURRENCE_RULE" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS" ALTER COLUMN "REMINDER_SETTING_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS" ALTER COLUMN "VEVENT_UID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_EVENTS_INVITEES" ALTER COLUMN "INVITEE_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" ALTER COLUMN "CUSTOM_EVENT_TYPE_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" ALTER COLUMN "ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" ALTER COLUMN "LAST_MODIFIER" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" ALTER COLUMN "STORE_KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_SETTINGS" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_USERS" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_REMINDER_USERS" ALTER COLUMN "USER_KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "COLOUR" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "CREATOR" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "PARENT_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "SPACE_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "STORE_KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "SUBSCRIPTION_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "TIME_ZONE_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS" ALTER COLUMN "USING_CUSTOM_EVENT_TYPE_ID" nvarchar(255) NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_GRP" ALTER COLUMN "GROUP_NAME" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_GRP" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_GRP" ALTER COLUMN "TYPE" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_USR" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_USR" ALTER COLUMN "TYPE" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PRIV_USR" ALTER COLUMN "USER_KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PROPS" ALTER COLUMN "KEY" nvarchar(255) NOT NULL;
ALTER TABLE "AO_950DC3_TC_SUBCALS_PROPS" ALTER COLUMN "SUB_CALENDAR_ID" nvarchar(255) NOT NULL;
ALTER TABLE "AO_A0B856_WEB_HOOK_LISTENER_AO" ALTER COLUMN "LAST_UPDATED_USER" nvarchar(255) NULL;
ALTER TABLE "AO_A0B856_WEB_HOOK_LISTENER_AO" ALTER COLUMN "REGISTRATION_METHOD" nvarchar(255) NOT NULL;
ALTER TABLE "AO_BAF3AA_AOINLINE_TASK" ALTER COLUMN "ASSIGNEE_USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_BAF3AA_AOINLINE_TASK" ALTER COLUMN "COMPLETE_USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_BAF3AA_AOINLINE_TASK" ALTER COLUMN "CREATOR_USER_KEY" nvarchar(255) NULL;
ALTER TABLE "AO_BAF3AA_AOINLINE_TASK" ALTER COLUMN "TASK_STATUS" nvarchar(255) NULL;
ALTER TABLE "AO_DC98AE_AOHELP_TIP" ALTER COLUMN "DISMISSED_HELP_TIP" nvarchar(255) NULL;
ALTER TABLE "AO_DC98AE_AOHELP_TIP" ALTER COLUMN "USER_KEY" nvarchar(255) NULL;
 
--Creation of non unique indexes
CREATE NONCLUSTERED INDEX index_ao_26db7f_ent831223480 ON "AO_26DB7F_ENTITIES_TO_ROOMS"("ROOM_ID");
CREATE NONCLUSTERED INDEX index_ao_26db7f_ent940053222 ON "AO_26DB7F_ENTITIES_TO_ROOMS"("ENTITY_KEY");
CREATE NONCLUSTERED INDEX index_ao_38321b_cus1828044926 ON "AO_38321B_CUSTOM_CONTENT_LINK"("CONTENT_KEY");
CREATE NONCLUSTERED INDEX index_ao_54c900_c_t667820477 ON "AO_54C900_C_TEMPLATE_REF"("CB_INDEX_PARENTID");
CREATE NONCLUSTERED INDEX index_ao_54c900_c_t757546442 ON "AO_54C900_C_TEMPLATE_REF"("CB_PARENTID");
CREATE NONCLUSTERED INDEX index_ao_54c900_c_t852152353 ON "AO_54C900_C_TEMPLATE_REF"("PARENT_ID");
CREATE NONCLUSTERED INDEX index_ao_54c900_spa357134289 ON "AO_54C900_SPACE_BLUEPRINT_AO"("HOME_PAGE_ID");
CREATE NONCLUSTERED INDEX index_ao_5fb9d7_aoh1981563178 ON "AO_5FB9D7_AOHIP_CHAT_USER"("USER_KEY");
CREATE NONCLUSTERED INDEX index_ao_5fb9d7_aoh49772492 ON "AO_5FB9D7_AOHIP_CHAT_USER"("HIP_CHAT_LINK_ID");
CREATE NONCLUSTERED INDEX index_ao_7cde43_eve1433596955 ON "AO_7CDE43_EVENT"("NOTIFICATION_ID");
CREATE NONCLUSTERED INDEX index_ao_7cde43_fil1140550715 ON "AO_7CDE43_FILTER_PARAM"("NOTIFICATION_ID");
CREATE NONCLUSTERED INDEX index_ao_7cde43_not7362182 ON "AO_7CDE43_NOTIFICATION"("NOTIFICATION_SCHEME_ID");
CREATE NONCLUSTERED INDEX index_ao_7cde43_rec1271577318 ON "AO_7CDE43_RECIPIENT"("NOTIFICATION_ID");
CREATE NONCLUSTERED INDEX index_ao_7cde43_ser828034299 ON "AO_7CDE43_SERVER_PARAM"("SERVER_CONFIG_ID");
CREATE NONCLUSTERED INDEX index_ao_92296b_aor1216492770 ON "AO_92296B_AORECENTLY_VIEWED"("CONTENT_ID");
CREATE NONCLUSTERED INDEX index_ao_92296b_aor1615591099 ON "AO_92296B_AORECENTLY_VIEWED"("SPACE_KEY");
CREATE NONCLUSTERED INDEX index_ao_92296b_aor205355936 ON "AO_92296B_AORECENTLY_VIEWED"("LAST_VIEW_DATE");
CREATE NONCLUSTERED INDEX index_ao_92296b_aor426054036 ON "AO_92296B_AORECENTLY_VIEWED"("USER_KEY");
CREATE NONCLUSTERED INDEX index_ao_92296b_aor818798913 ON "AO_92296B_AORECENTLY_VIEWED"("CONTENT_TYPE");
CREATE NONCLUSTERED INDEX index_ao_9412a1_aon1547032463 ON "AO_9412A1_AONOTIFICATION"("CREATED");
CREATE NONCLUSTERED INDEX index_ao_9412a1_aon648423710 ON "AO_9412A1_AONOTIFICATION"("USER");
CREATE NONCLUSTERED INDEX index_ao_9412a1_aon849931648 ON "AO_9412A1_AONOTIFICATION"("GLOBAL_ID");
CREATE NONCLUSTERED INDEX index_ao_9412a1_aot1465568358 ON "AO_9412A1_AOTASK"("GLOBAL_ID");
CREATE NONCLUSTERED INDEX index_ao_9412a1_aotask_user ON "AO_9412A1_AOTASK"("USER");
CREATE NONCLUSTERED INDEX index_ao_9412a1_use1222319987 ON "AO_9412A1_USER_APP_LINK"("USER_ID");
CREATE NONCLUSTERED INDEX index_ao_9412a1_use643533071 ON "AO_9412A1_USER_APP_LINK"("APPLICATION_LINK_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1437233256 ON "AO_950DC3_TC_CUSTOM_EV_TYPES"("BELONG_SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1806144629 ON "AO_950DC3_TC_DISABLE_EV_TYPES"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1286773626 ON "AO_950DC3_TC_EVENTS"("REMINDER_SETTING_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1526147574 ON "AO_950DC3_TC_EVENTS"("UTC_START");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1709841361 ON "AO_950DC3_TC_EVENTS"("START");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_363043564 ON "AO_950DC3_TC_EVENTS"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_38648977 ON "AO_950DC3_TC_EVENTS"("UTC_END");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_851944294 ON "AO_950DC3_TC_EVENTS"("VEVENT_UID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_events_end ON "AO_950DC3_TC_EVENTS"("END");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1977525806 ON "AO_950DC3_TC_EVENTS_EXCL"("EVENT_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_100715625 ON "AO_950DC3_TC_EVENTS_INVITEES"("EVENT_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1684546011 ON "AO_950DC3_TC_REMINDER_SETTINGS"("PERIOD");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1886631335 ON "AO_950DC3_TC_REMINDER_SETTINGS"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_2073603249 ON "AO_950DC3_TC_REMINDER_SETTINGS"("CUSTOM_EVENT_TYPE_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_786531555 ON "AO_950DC3_TC_REMINDER_SETTINGS"("STORE_KEY");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_122365134 ON "AO_950DC3_TC_REMINDER_USERS"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_2091184233 ON "AO_950DC3_TC_SUBCALS"("SPACE_KEY");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_554676722 ON "AO_950DC3_TC_SUBCALS"("STORE_KEY");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_836865362 ON "AO_950DC3_TC_SUBCALS"("SUBSCRIPTION_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_932705473 ON "AO_950DC3_TC_SUBCALS"("PARENT_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1891203755 ON "AO_950DC3_TC_SUBCALS_PRIV_GRP"("TYPE");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_525483330 ON "AO_950DC3_TC_SUBCALS_PRIV_GRP"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1978066438 ON "AO_950DC3_TC_SUBCALS_PRIV_USR"("TYPE");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_997641231 ON "AO_950DC3_TC_SUBCALS_PRIV_USR"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1847876863 ON "AO_950DC3_TC_SUBCALS_PROPS"("KEY");
CREATE NONCLUSTERED INDEX index_ao_950dc3_tc_1861854175 ON "AO_950DC3_TC_SUBCALS_PROPS"("SUB_CALENDAR_ID");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi1066945234 ON "AO_BAF3AA_AOINLINE_TASK"("CONTENT_ID");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi1143751131 ON "AO_BAF3AA_AOINLINE_TASK"("TASK_STATUS");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi1389674752 ON "AO_BAF3AA_AOINLINE_TASK"("CREATE_DATE");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi1395974671 ON "AO_BAF3AA_AOINLINE_TASK"("CREATOR_USER_KEY");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi1978441610 ON "AO_BAF3AA_AOINLINE_TASK"("DUE_DATE");
CREATE NONCLUSTERED INDEX index_ao_baf3aa_aoi866493194 ON "AO_BAF3AA_AOINLINE_TASK"("ASSIGNEE_USER_KEY");
CREATE NONCLUSTERED INDEX index_ao_dc98ae_aoh1533992358 ON "AO_DC98AE_AOHELP_TIP"("USER_KEY");
CREATE NONCLUSTERED INDEX index_ao_dc98ae_aoh411805038 ON "AO_DC98AE_AOHELP_TIP"("DISMISSED_HELP_TIP");
 
--Creation of unique indexes
CREATE UNIQUE NONCLUSTERED INDEX U_AO_9412A1_AOUSER_USERNAME ON "AO_9412A1_AOUSER"("USERNAME");
 
--Creation of primary keys
ALTER TABLE AO_9412A1_AOREGISTRATION ADD PRIMARY KEY (ID);
ALTER TABLE AO_950DC3_TC_CUSTOM_EV_TYPES ADD PRIMARY KEY (ID);
ALTER TABLE AO_950DC3_TC_REMINDER_SETTINGS ADD PRIMARY KEY (ID);
ALTER TABLE AO_950DC3_TC_SUBCALS ADD PRIMARY KEY (ID);
 
--Creation of foreign keys
ALTER TABLE AO_7CDE43_SERVER_PARAM ADD CONSTRAINT fk_ao_7cde43_server_param_server_config_id FOREIGN KEY (SERVER_CONFIG_ID) references AO_7CDE43_SERVER_CONFIG(ID);
ALTER TABLE AO_7CDE43_NOTIFICATION ADD CONSTRAINT fk_ao_7cde43_notification_notification_scheme_id FOREIGN KEY (NOTIFICATION_SCHEME_ID) references AO_7CDE43_NOTIFICATION_SCHEME(ID);
ALTER TABLE AO_7CDE43_EVENT ADD CONSTRAINT fk_ao_7cde43_event_notification_id FOREIGN KEY (NOTIFICATION_ID) references AO_7CDE43_NOTIFICATION(ID);
ALTER TABLE AO_7CDE43_RECIPIENT ADD CONSTRAINT fk_ao_7cde43_recipient_notification_id FOREIGN KEY (NOTIFICATION_ID) references AO_7CDE43_NOTIFICATION(ID);
ALTER TABLE AO_7CDE43_FILTER_PARAM ADD CONSTRAINT fk_ao_7cde43_filter_param_notification_id FOREIGN KEY (NOTIFICATION_ID) references AO_7CDE43_NOTIFICATION(ID);
ALTER TABLE AO_5FB9D7_AOHIP_CHAT_USER ADD CONSTRAINT fk_ao_5fb9d7_aohip_chat_user_hip_chat_link_id FOREIGN KEY (HIP_CHAT_LINK_ID) references AO_5FB9D7_AOHIP_CHAT_LINK(ID);
ALTER TABLE AO_9412A1_USER_APP_LINK ADD CONSTRAINT fk_ao_9412a1_user_app_link_user_id FOREIGN KEY (USER_ID) references AO_9412A1_AOUSER(ID);
ALTER TABLE AO_950DC3_TC_SUBCALS ADD CONSTRAINT fk_ao_950dc3_tc_subcals_parent_id FOREIGN KEY (PARENT_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_SUBCALS ADD CONSTRAINT fk_ao_950dc3_tc_subcals_subscription_id FOREIGN KEY (SUBSCRIPTION_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_SUBCALS_PRIV_USR ADD CONSTRAINT fk_ao_950dc3_tc_subcals_priv_usr_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_SUBCALS_PRIV_GRP ADD CONSTRAINT fk_ao_950dc3_tc_subcals_priv_grp_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_SUBCALS_PROPS ADD CONSTRAINT fk_ao_950dc3_tc_subcals_props_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_EVENTS ADD CONSTRAINT fk_ao_950dc3_tc_events_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_DISABLE_EV_TYPES ADD CONSTRAINT fk_ao_950dc3_tc_disable_ev_types_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_CUSTOM_EV_TYPES ADD CONSTRAINT fk_ao_950dc3_tc_custom_ev_types_belong_sub_calendar_id FOREIGN KEY (BELONG_SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_REMINDER_USERS ADD CONSTRAINT fk_ao_950dc3_tc_reminder_users_sub_calendar_id FOREIGN KEY (SUB_CALENDAR_ID) references AO_950DC3_TC_SUBCALS(ID);
ALTER TABLE AO_950DC3_TC_EVENTS ADD CONSTRAINT fk_ao_950dc3_tc_events_reminder_setting_id FOREIGN KEY (REMINDER_SETTING_ID) references AO_950DC3_TC_REMINDER_SETTINGS(ID);
ALTER TABLE AO_950DC3_TC_EVENTS_INVITEES ADD CONSTRAINT fk_ao_950dc3_tc_events_invitees_event_id FOREIGN KEY (EVENT_ID) references AO_950DC3_TC_EVENTS(ID);
ALTER TABLE AO_950DC3_TC_EVENTS_EXCL ADD CONSTRAINT fk_ao_950dc3_tc_events_excl_event_id FOREIGN KEY (EVENT_ID) references AO_950DC3_TC_EVENTS(ID);
ALTER TABLE AO_54C900_C_TEMPLATE_REF ADD CONSTRAINT fk_ao_54c900_c_template_ref_cb_parentid FOREIGN KEY (CB_PARENTID) references AO_54C900_CONTENT_BLUEPRINT_AO(ID);
ALTER TABLE AO_54C900_C_TEMPLATE_REF ADD CONSTRAINT fk_ao_54c900_c_template_ref_cb_index_parentid FOREIGN KEY (CB_INDEX_PARENTID) references AO_54C900_CONTENT_BLUEPRINT_AO(ID);
ALTER TABLE AO_54C900_C_TEMPLATE_REF ADD CONSTRAINT fk_ao_54c900_c_template_ref_parent_id FOREIGN KEY (PARENT_ID) references AO_54C900_C_TEMPLATE_REF(ID);
ALTER TABLE AO_54C900_SPACE_BLUEPRINT_AO ADD CONSTRAINT fk_ao_54c900_space_blueprint_ao_home_page_id FOREIGN KEY (HOME_PAGE_ID) references AO_54C900_C_TEMPLATE_REF(ID); 
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.