diff --git a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/CREATE.sql b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/CREATE.sql index cfbb93837767..8588138670d3 100644 --- a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/CREATE.sql +++ b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/CREATE.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - {{ nameInput.text }}, - {{ genderDropdown.selectedOptionValue }}, - {{ emailInput.text }} - ); + ( + {{ nameInput.text }}, + {{ genderDropdown.selectedOptionValue }}, + {{ emailInput.text }} + ); diff --git a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/SELECT.sql b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/SELECT.sql index f4d3905f05d3..57ce558bd267 100644 --- a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/SELECT.sql +++ b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/SELECT.sql @@ -1,3 +1,3 @@ SELECT TOP 10 * FROM <>; --- Please enter a valid table name and hit RUN \ No newline at end of file +-- Please enter a valid table name and hit RUN diff --git a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/UPDATE.sql index de4915e6fd1b..5ecd96ba4dcf 100644 --- a/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/mssqlPlugin/src/main/resources/templates/UPDATE.sql @@ -1,3 +1,3 @@ UPDATE users - SET status = 'APPROVED' - WHERE id = {{ usersTable.selectedRow.id }}; + SET status = 'APPROVED' + WHERE id = {{ usersTable.selectedRow.id }}; diff --git a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/CREATE.sql b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/CREATE.sql index b5253c2bf8b2..8588138670d3 100644 --- a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/CREATE.sql +++ b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/CREATE.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - {{ nameInput.text }}, - {{ genderDropdown.selectedOptionValue }}, - {{ emailInput.text }} - ); \ No newline at end of file + ( + {{ nameInput.text }}, + {{ genderDropdown.selectedOptionValue }}, + {{ emailInput.text }} + ); diff --git a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/DELETE.sql b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/DELETE.sql index e7014662d50a..459aa04c543d 100644 --- a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/DELETE.sql +++ b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/DELETE.sql @@ -1 +1 @@ -DELETE FROM users WHERE id = -1; \ No newline at end of file +DELETE FROM users WHERE id = -1; diff --git a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/UPDATE.sql index facf9fc3f9d6..5ecd96ba4dcf 100644 --- a/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/mysqlPlugin/src/main/resources/templates/UPDATE.sql @@ -1,3 +1,3 @@ UPDATE users - SET status = 'APPROVED' - WHERE id = {{ usersTable.selectedRow.id }}; \ No newline at end of file + SET status = 'APPROVED' + WHERE id = {{ usersTable.selectedRow.id }}; diff --git a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/DELETE.sql b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/DELETE.sql index c5000f4ee8ea..a763c222abbd 100755 --- a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/DELETE.sql +++ b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/DELETE.sql @@ -1 +1 @@ -DELETE FROM users WHERE id = {{idInput.text}} \ No newline at end of file +DELETE FROM users WHERE id = {{idInput.text}} diff --git a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/INSERT.sql b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/INSERT.sql index f59768c5c550..e4a64159fed7 100755 --- a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/INSERT.sql +++ b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/INSERT.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - {{ nameInput.text }}, - {{ genderDropdown.selectedOptionValue }}, - {{ emailInput.text }} - ) \ No newline at end of file + ( + {{ nameInput.text }}, + {{ genderDropdown.selectedOptionValue }}, + {{ emailInput.text }} + ) diff --git a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/UPDATE.sql index 1e8246500e01..2b9cb5d2a0e2 100755 --- a/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/oraclePlugin/src/main/resources/templates/UPDATE.sql @@ -1 +1 @@ -UPDATE users SET status = 'APPROVED' WHERE id = {{ usersTable.selectedRow.id }} \ No newline at end of file +UPDATE users SET status = 'APPROVED' WHERE id = {{ usersTable.selectedRow.id }} diff --git a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/CREATE.sql b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/CREATE.sql index b5253c2bf8b2..8588138670d3 100644 --- a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/CREATE.sql +++ b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/CREATE.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - {{ nameInput.text }}, - {{ genderDropdown.selectedOptionValue }}, - {{ emailInput.text }} - ); \ No newline at end of file + ( + {{ nameInput.text }}, + {{ genderDropdown.selectedOptionValue }}, + {{ emailInput.text }} + ); diff --git a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/DELETE.sql b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/DELETE.sql index e7014662d50a..459aa04c543d 100644 --- a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/DELETE.sql +++ b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/DELETE.sql @@ -1 +1 @@ -DELETE FROM users WHERE id = -1; \ No newline at end of file +DELETE FROM users WHERE id = -1; diff --git a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/SELECT.sql b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/SELECT.sql index 1c25fafff4ab..036ff8b22974 100644 --- a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/SELECT.sql +++ b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/SELECT.sql @@ -1,3 +1,3 @@ SELECT * FROM <> LIMIT 10; --- Please enter a valid table name and hit RUN \ No newline at end of file +-- Please enter a valid table name and hit RUN diff --git a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/UPDATE.sql index de4915e6fd1b..5ecd96ba4dcf 100644 --- a/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/postgresPlugin/src/main/resources/templates/UPDATE.sql @@ -1,3 +1,3 @@ UPDATE users - SET status = 'APPROVED' - WHERE id = {{ usersTable.selectedRow.id }}; + SET status = 'APPROVED' + WHERE id = {{ usersTable.selectedRow.id }}; diff --git a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/CREATE.sql b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/CREATE.sql index b5253c2bf8b2..8588138670d3 100644 --- a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/CREATE.sql +++ b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/CREATE.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - {{ nameInput.text }}, - {{ genderDropdown.selectedOptionValue }}, - {{ emailInput.text }} - ); \ No newline at end of file + ( + {{ nameInput.text }}, + {{ genderDropdown.selectedOptionValue }}, + {{ emailInput.text }} + ); diff --git a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/DELETE.sql b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/DELETE.sql index e7014662d50a..459aa04c543d 100644 --- a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/DELETE.sql +++ b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/DELETE.sql @@ -1 +1 @@ -DELETE FROM users WHERE id = -1; \ No newline at end of file +DELETE FROM users WHERE id = -1; diff --git a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/SELECT.sql b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/SELECT.sql index 1c25fafff4ab..036ff8b22974 100644 --- a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/SELECT.sql +++ b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/SELECT.sql @@ -1,3 +1,3 @@ SELECT * FROM <> LIMIT 10; --- Please enter a valid table name and hit RUN \ No newline at end of file +-- Please enter a valid table name and hit RUN diff --git a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/UPDATE.sql index facf9fc3f9d6..5ecd96ba4dcf 100644 --- a/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/redshiftPlugin/src/main/resources/templates/UPDATE.sql @@ -1,3 +1,3 @@ UPDATE users - SET status = 'APPROVED' - WHERE id = {{ usersTable.selectedRow.id }}; \ No newline at end of file + SET status = 'APPROVED' + WHERE id = {{ usersTable.selectedRow.id }}; diff --git a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/CREATE.sql b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/CREATE.sql index 3166e4d345dd..85b7e1cce8e9 100644 --- a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/CREATE.sql +++ b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/CREATE.sql @@ -1,8 +1,8 @@ INSERT INTO users - (name, gender, email) + (name, gender, email) VALUES - ( - '{{ nameInput.text }}', - '{{ genderDropdown.selectedOptionValue }}', - '{{ emailInput.text }}' - ); \ No newline at end of file + ( + '{{ nameInput.text }}', + '{{ genderDropdown.selectedOptionValue }}', + '{{ emailInput.text }}' + ); diff --git a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/DELETE.sql b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/DELETE.sql index e7014662d50a..459aa04c543d 100644 --- a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/DELETE.sql +++ b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/DELETE.sql @@ -1 +1 @@ -DELETE FROM users WHERE id = -1; \ No newline at end of file +DELETE FROM users WHERE id = -1; diff --git a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/SELECT.sql b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/SELECT.sql index 1c25fafff4ab..036ff8b22974 100644 --- a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/SELECT.sql +++ b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/SELECT.sql @@ -1,3 +1,3 @@ SELECT * FROM <> LIMIT 10; --- Please enter a valid table name and hit RUN \ No newline at end of file +-- Please enter a valid table name and hit RUN diff --git a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/UPDATE.sql b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/UPDATE.sql index 966633a70592..0a7e95bb77c3 100644 --- a/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/UPDATE.sql +++ b/app/server/appsmith-plugins/snowflakePlugin/src/main/resources/templates/UPDATE.sql @@ -1,3 +1,3 @@ UPDATE users - SET status = 'APPROVED' - WHERE id = '{{ usersTable.selectedRow.id }}'; \ No newline at end of file + SET status = 'APPROVED' + WHERE id = '{{ usersTable.selectedRow.id }}'; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V001__createTables.sql b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V001__createTables.sql index 03da54189b41..61a9831520c0 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V001__createTables.sql +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V001__createTables.sql @@ -1,527 +1,527 @@ create table action_collection ( - id varchar(255) not null - primary key, - base_id text, - branch_name text, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - application_id text, - context_type text, - published_collection jsonb, - unpublished_collection jsonb, - workspace_id text + id varchar(255) not null + primary key, + base_id text, + branch_name text, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + application_id text, + context_type text, + published_collection jsonb, + unpublished_collection jsonb, + workspace_id text ); create table application ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - app_is_example boolean not null default false, - application_version integer, - client_schema_version integer, - cloned_from_application_id text, - collapse_invisible_widgets boolean, - color text, - edit_mode_theme_id text, - embed_setting jsonb, - evaluation_version integer, - export_with_configuration boolean, - fork_with_configuration boolean, - forked_from_template_title text, - forking_enabled boolean, - git_application_metadata jsonb, - icon text, - is_auto_update boolean, - is_community_template boolean, - is_manual_update boolean, - is_public boolean, - last_deployed_at timestamp(6) with time zone, - last_edited_at timestamp(6) with time zone, - name text not null, - pages jsonb, - published_app_layout jsonb, - published_application_detail jsonb, - published_customjslibs jsonb, - published_mode_theme_id text, - published_pages jsonb, - server_schema_version integer, - slug text, - unpublished_app_layout jsonb, - unpublished_application_detail jsonb, - unpublished_customjslibs jsonb, - view_mode boolean, - workspace_id text NOT NULL + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + app_is_example boolean not null default false, + application_version integer, + client_schema_version integer, + cloned_from_application_id text, + collapse_invisible_widgets boolean, + color text, + edit_mode_theme_id text, + embed_setting jsonb, + evaluation_version integer, + export_with_configuration boolean, + fork_with_configuration boolean, + forked_from_template_title text, + forking_enabled boolean, + git_application_metadata jsonb, + icon text, + is_auto_update boolean, + is_community_template boolean, + is_manual_update boolean, + is_public boolean, + last_deployed_at timestamp(6) with time zone, + last_edited_at timestamp(6) with time zone, + name text not null, + pages jsonb, + published_app_layout jsonb, + published_application_detail jsonb, + published_customjslibs jsonb, + published_mode_theme_id text, + published_pages jsonb, + server_schema_version integer, + slug text, + unpublished_app_layout jsonb, + unpublished_application_detail jsonb, + unpublished_customjslibs jsonb, + view_mode boolean, + workspace_id text NOT NULL ); create table application_snapshot ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - application_id text NOT NULL, - chunk_order integer NOT NULL, - data bytea + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + application_id text NOT NULL, + chunk_order integer NOT NULL, + data bytea ); create table asset ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - content_type text, - data bytea + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + content_type text, + data bytea ); create table collection ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - actions jsonb, - application_id text, - name text, - shared boolean, - workspace_id text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + actions jsonb, + application_id text, + name text, + shared boolean, + workspace_id text ); create table config ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - config jsonb, - name text - constraint uk_kjjh66cda2b9nc24it8fhbfwx - unique + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + config jsonb, + name text + constraint uk_kjjh66cda2b9nc24it8fhbfwx + unique ); create table customjslib ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - default_resources jsonb, - accessor jsonb, - -- This was `String` in MongoDB, but since we need to store `NUL` (\u0000) character in it (for libraries like - -- xlsx), which Postgres doesn't allow in text/varchar, we have to use a byte array (`bytea`) here. - defs bytea, - docs_url text, - name text, - uid_string text, - url text, - version text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + default_resources jsonb, + accessor jsonb, + -- This was `String` in MongoDB, but since we need to store `NUL` (\u0000) character in it (for libraries like + -- xlsx), which Postgres doesn't allow in text/varchar, we have to use a byte array (`bytea`) here. + defs bytea, + docs_url text, + name text, + uid_string text, + url text, + version text ); create table datasource ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - datasource_configuration jsonb, - has_datasource_storage boolean, - invalids jsonb, - is_configured boolean, - is_mock boolean, - is_template boolean, - name text, - plugin_id text, - template_name text, - workspace_id text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + datasource_configuration jsonb, + has_datasource_storage boolean, + invalids jsonb, + is_configured boolean, + is_mock boolean, + is_template boolean, + name text, + plugin_id text, + template_name text, + workspace_id text ); create table datasource_storage ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - datasource_configuration jsonb, - datasource_id text, - environment_id text, - invalids jsonb, - is_configured boolean + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + datasource_configuration jsonb, + datasource_id text, + environment_id text, + invalids jsonb, + is_configured boolean ); create table datasource_storage_structure ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - datasource_id text, - environment_id text, - structure jsonb + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + datasource_id text, + environment_id text, + structure jsonb ); create table email_verification_token ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - email text, - token_generated_at timestamp(6) with time zone, - token_hash text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + email text, + token_generated_at timestamp(6) with time zone, + token_hash text ); create table git_deploy_keys ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - email text, - git_auth jsonb + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + email text, + git_auth jsonb ); create table new_action ( - id varchar(255) not null - primary key, - base_id text, - branch_name text, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - application_id text, - documentation jsonb, - plugin_id text, - plugin_type text, - published_action jsonb, - unpublished_action jsonb, - workspace_id text + id varchar(255) not null + primary key, + base_id text, + branch_name text, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + application_id text, + documentation jsonb, + plugin_id text, + plugin_type text, + published_action jsonb, + unpublished_action jsonb, + workspace_id text ); create table new_page ( - id varchar(255) not null - primary key, - base_id text, - branch_name text, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - application_id text, - published_page jsonb, - unpublished_page jsonb + id varchar(255) not null + primary key, + base_id text, + branch_name text, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + application_id text, + published_page jsonb, + unpublished_page jsonb ); create table password_reset_token ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - email text, - first_request_time timestamp(6) with time zone, - request_count integer not null DEFAULT 0, - token_hash text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + email text, + first_request_time timestamp(6) with time zone, + request_count integer not null DEFAULT 0, + token_hash text ); create table permission_group ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - assigned_to_group_ids jsonb, - assigned_to_user_ids jsonb, - default_domain_id text, - default_domain_type text, - default_workspace_id text, - description text, - name text not null, - permissions jsonb, - tenant_id text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + assigned_to_group_ids jsonb, + assigned_to_user_ids jsonb, + default_domain_id text, + default_domain_type text, + default_workspace_id text, + description text, + name text not null, + permissions jsonb, + tenant_id text ); create table plugin ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - action_component text, - action_params jsonb, - action_ui_config jsonb, - allow_user_datasources boolean, - datasource_component text, - datasource_params jsonb, - datasource_ui_config jsonb, - default_install boolean, - documentation_link text, - generatecrudpage_component text, - icon_location text, - is_dependent_oncs boolean, - is_remote_plugin boolean not null default false, - is_supported_for_air_gap boolean not null default true, - jar_location text, - max_appsmith_version_supported text, - min_appsmith_version_supported text, - name text, - package_name text NOT NULL, - plugin_name text, - response_type text, - type text, - ui_component text, - version text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + action_component text, + action_params jsonb, + action_ui_config jsonb, + allow_user_datasources boolean, + datasource_component text, + datasource_params jsonb, + datasource_ui_config jsonb, + default_install boolean, + documentation_link text, + generatecrudpage_component text, + icon_location text, + is_dependent_oncs boolean, + is_remote_plugin boolean not null default false, + is_supported_for_air_gap boolean not null default true, + jar_location text, + max_appsmith_version_supported text, + min_appsmith_version_supported text, + name text, + package_name text NOT NULL, + plugin_name text, + response_type text, + type text, + ui_component text, + version text ); create table sequence ( - name text not null - primary key, - next_number bigint + name text not null + primary key, + next_number bigint ); create table tenant ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - display_name text, - pricing_plan text, - slug text unique, - tenant_configuration jsonb + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + display_name text, + pricing_plan text, + slug text unique, + tenant_configuration jsonb ); create table theme ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - application_id text, - config jsonb, - display_name text, - is_system_theme boolean not null, - name text, - properties jsonb, - stylesheet jsonb, - workspace_id text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + application_id text, + config jsonb, + display_name text, + is_system_theme boolean not null, + name text, + properties jsonb, + stylesheet jsonb, + workspace_id text ); create table usage_pulse ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - email text, - instance_id text, - is_anonymous_user boolean, - tenant_id text, - "user" text, - view_mode boolean + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + email text, + instance_id text, + is_anonymous_user boolean, + tenant_id text, + "user" text, + view_mode boolean ); create table "user" ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - current_workspace_id text, - email text, - email_verification_required boolean, - email_verified boolean, - examples_workspace_id text, - hashed_email text, - invite_token text, - is_anonymous boolean, - is_enabled boolean, - is_system_generated boolean, - last_active_at timestamp(6) with time zone, - name text, - password text, - password_reset_initiated boolean, - source text, - state text, - tenant_id text, - workspace_ids jsonb + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + current_workspace_id text, + email text, + email_verification_required boolean, + email_verified boolean, + examples_workspace_id text, + hashed_email text, + invite_token text, + is_anonymous boolean, + is_enabled boolean, + is_system_generated boolean, + last_active_at timestamp(6) with time zone, + name text, + password text, + password_reset_initiated boolean, + source text, + state text, + tenant_id text, + workspace_ids jsonb ); create table user_data ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - git_profiles jsonb, - is_intercom_consent_given boolean not null default false, - proficiency text, - profile_photo_asset_id text, - recently_used_app_ids jsonb, - recently_used_entity_ids jsonb, - recently_used_workspace_ids jsonb, - release_notes_viewed_version text, - role text, - use_case text, - user_claims jsonb, - user_id text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + git_profiles jsonb, + is_intercom_consent_given boolean not null default false, + proficiency text, + profile_photo_asset_id text, + recently_used_app_ids jsonb, + recently_used_entity_ids jsonb, + recently_used_workspace_ids jsonb, + release_notes_viewed_version text, + role text, + use_case text, + user_claims jsonb, + user_id text ); create table workspace ( - id varchar(255) not null - primary key, - created_at timestamp(6) with time zone, - created_by text, - deleted_at timestamp(6) with time zone, - git_sync_id text, - modified_by text, - policies jsonb, - policy_map jsonb, - updated_at timestamp(6) with time zone, - default_permission_groups jsonb, - domain text, - email text, - has_environments boolean, - is_auto_generated_workspace boolean, - logo_asset_id text, - name text, - plugins jsonb, - slug text, - tenant_id text, - website text + id varchar(255) not null + primary key, + created_at timestamp(6) with time zone, + created_by text, + deleted_at timestamp(6) with time zone, + git_sync_id text, + modified_by text, + policies jsonb, + policy_map jsonb, + updated_at timestamp(6) with time zone, + default_permission_groups jsonb, + domain text, + email text, + has_environments boolean, + is_auto_generated_workspace boolean, + logo_asset_id text, + name text, + plugins jsonb, + slug text, + tenant_id text, + website text ); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V003__createIndexes.sql b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V003__createIndexes.sql index 02078a080f50..d7ef66d69e8f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V003__createIndexes.sql +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V003__createIndexes.sql @@ -8,26 +8,26 @@ create unique index if not exists sequence_name_key on sequence(name); -- action_collection table constraints create index if not exists action_collection_application_id_idx - on action_collection(application_id) - WHERE deleted_at IS NULL; + on action_collection(application_id) + WHERE deleted_at IS NULL; create index if not exists action_collection_unpublished_page_id_idx - on action_collection((unpublished_collection ->> 'pageId')) - WHERE deleted_at IS NULL; + on action_collection((unpublished_collection ->> 'pageId')) + WHERE deleted_at IS NULL; create index if not exists action_collection_published_page_id_idx - on action_collection((published_collection ->> 'pageId')) - WHERE deleted_at IS NULL AND published_collection IS NOT NULL; + on action_collection((published_collection ->> 'pageId')) + WHERE deleted_at IS NULL AND published_collection IS NOT NULL; create index if not exists action_collection_base_id_branch_name_idx - on action_collection(base_id, branch_name) - WHERE deleted_at IS NULL; + on action_collection(base_id, branch_name) + WHERE deleted_at IS NULL; -- plugin table constraints create unique index if not exists plugin_package_name_key - on plugin(package_name) - WHERE plugin_name IS NULL AND version IS NULL AND deleted_at IS NULL; + on plugin(package_name) + WHERE plugin_name IS NULL AND version IS NULL AND deleted_at IS NULL; create unique index if not exists plugin_package_name_version_key - on plugin(package_name, plugin_name, version) - WHERE plugin_name IS NOT NULL AND version IS NOT NULL AND deleted_at IS NULL; + on plugin(package_name, plugin_name, version) + WHERE plugin_name IS NOT NULL AND version IS NOT NULL AND deleted_at IS NULL; -- Ideally we should have this constraint, but we have data that unfortunately violates this. -- ALTER TABLE plugin @@ -42,69 +42,69 @@ create unique index if not exists user_id_key on user_data(user_id); -- datasource table constraints create unique index if not exists datasource_workspace_name_key - on datasource(workspace_id, name) - WHERE deleted_at is NULL; + on datasource(workspace_id, name) + WHERE deleted_at is NULL; -- application table constraints create unique index if not exists application_workspace_name_key - on application(workspace_id, name) - WHERE deleted_at IS NULL AND (git_application_metadata IS NULL OR (git_application_metadata ->> 'remoteUrl' IS NULL AND git_application_metadata ->> 'branchName' IS NULL)); + on application(workspace_id, name) + WHERE deleted_at IS NULL AND (git_application_metadata IS NULL OR (git_application_metadata ->> 'remoteUrl' IS NULL AND git_application_metadata ->> 'branchName' IS NULL)); create unique index if not exists application_workspace_name_git_application_metadata_key - on application(workspace_id, name, (git_application_metadata ->> 'remoteUrl'), (git_application_metadata ->>'branchName')) - WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL AND git_application_metadata ->> 'remoteUrl' IS NOT NULL AND git_application_metadata ->> 'branchName' IS NOT NULL; + on application(workspace_id, name, (git_application_metadata ->> 'remoteUrl'), (git_application_metadata ->>'branchName')) + WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL AND git_application_metadata ->> 'remoteUrl' IS NOT NULL AND git_application_metadata ->> 'branchName' IS NOT NULL; create index if not exists application_git_metadata_application_id_branch_idx - on application((git_application_metadata ->> 'defaultApplicationId'), (git_application_metadata ->> 'branchName')) - WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL; + on application((git_application_metadata ->> 'defaultApplicationId'), (git_application_metadata ->> 'branchName')) + WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL; create index if not exists application_git_metadata_artifact_id_branch_idx - on application((git_application_metadata ->> 'branchName'), (git_application_metadata ->> 'defaultArtifactId')) - WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL; + on application((git_application_metadata ->> 'branchName'), (git_application_metadata ->> 'defaultArtifactId')) + WHERE deleted_at IS NULL AND git_application_metadata IS NOT NULL; -- datasource_storage table constraints create unique index if not exists datasource_storage_datasource_id_key - on datasource_storage(datasource_id) - WHERE environment_id IS NULL AND deleted_at IS NULL; + on datasource_storage(datasource_id) + WHERE environment_id IS NULL AND deleted_at IS NULL; create unique index if not exists datasource_storage_datasource_id_env_id_key - on datasource_storage(datasource_id, environment_id) - WHERE environment_id IS NOT NULL AND deleted_at IS NULL; + on datasource_storage(datasource_id, environment_id) + WHERE environment_id IS NOT NULL AND deleted_at IS NULL; create index if not exists datasource_storage_env_id_idx - on datasource_storage(environment_id) - WHERE deleted_at IS NULL; + on datasource_storage(environment_id) + WHERE deleted_at IS NULL; -- datasource_storage_structure table constraints create unique index if not exists dss_datasource_id_key - on datasource_storage_structure(datasource_id) - WHERE environment_id IS NULL AND deleted_at IS NULL; + on datasource_storage_structure(datasource_id) + WHERE environment_id IS NULL AND deleted_at IS NULL; create unique index if not exists dss_datasource_env_key - on datasource_storage_structure(datasource_id, environment_id) - WHERE environment_id IS NOT NULL AND deleted_at IS NULL; + on datasource_storage_structure(datasource_id, environment_id) + WHERE environment_id IS NOT NULL AND deleted_at IS NULL; -- application_snapshot table constraints create unique index if not exists application_snapshot_application_chunk_order_key - on application_snapshot(application_id, chunk_order); + on application_snapshot(application_id, chunk_order); -- customjslibs table constraints create index if not exists custom_js_libs_name_idx - on customjslib(uid_string); + on customjslib(uid_string); -- new_action table constraints create index if not exists new_action_application_id_idx - on new_action(application_id) - WHERE deleted_at IS NULL; + on new_action(application_id) + WHERE deleted_at IS NULL; create index if not exists new_action_unpublished_page_id_idx - on new_action((unpublished_action ->> 'pageId')) - WHERE deleted_at IS NULL; + on new_action((unpublished_action ->> 'pageId')) + WHERE deleted_at IS NULL; create index if not exists new_action_published_page_id_idx - on new_action((published_action ->> 'pageId')) - WHERE deleted_at IS NULL AND published_action IS NOT NULL; + on new_action((published_action ->> 'pageId')) + WHERE deleted_at IS NULL AND published_action IS NOT NULL; create index if not exists new_action_application_id_plugin_type_idx - on new_action(application_id, plugin_type) - WHERE deleted_at IS NULL; + on new_action(application_id, plugin_type) + WHERE deleted_at IS NULL; create index if not exists new_action_unpublished_collection_id_idx - on new_action((unpublished_action ->> 'collectionId')) - WHERE deleted_at IS NULL; + on new_action((unpublished_action ->> 'collectionId')) + WHERE deleted_at IS NULL; create index if not exists new_action_published_collection_id_idx - on new_action((published_action ->> 'collectionId')) - WHERE deleted_at IS NULL AND published_action IS NOT NULL; + on new_action((published_action ->> 'collectionId')) + WHERE deleted_at IS NULL AND published_action IS NOT NULL; -- create index if not exists new_action_unpublished_datasource_id_idx -- on new_action((unpublished_action ->> 'datasource' ->> 'id')) @@ -113,37 +113,36 @@ create index if not exists new_action_published_collection_id_idx -- on new_action((published_action ->> 'datasource' ->> 'id')) -- WHERE deleted_at IS NULL AND published_action IS NOT NULL AND published_action ->> 'datasource' IS NOT NULL; create index if not exists new_action_base_id_branch_name_idx - on new_action(base_id, branch_name) - WHERE deleted_at IS NULL; + on new_action(base_id, branch_name) + WHERE deleted_at IS NULL; -- new_page table constraints create index if not exists new_page_application_id_idx - on new_page(application_id) - WHERE deleted_at IS NULL; + on new_page(application_id) + WHERE deleted_at IS NULL; create index if not exists new_page_base_id_branch_name_idx - on new_page(base_id, branch_name) - WHERE deleted_at IS NULL; + on new_page(base_id, branch_name) + WHERE deleted_at IS NULL; -- permission_group table constraints create index if not exists permission_group_user_ids_idx - on permission_group(assigned_to_user_ids) - WHERE deleted_at IS NULL; + on permission_group(assigned_to_user_ids) + WHERE deleted_at IS NULL; create index if not exists permission_group_domain_id_domain_type_idx - on permission_group(default_domain_id, default_domain_type) - WHERE deleted_at IS NULL; + on permission_group(default_domain_id, default_domain_type) + WHERE deleted_at IS NULL; -- theme table constraints create index if not exists theme_system_theme_idx - on theme(is_system_theme); + on theme(is_system_theme); create index if not exists theme_application_id_idx - on theme(application_id) - WHERE deleted_at IS NULL; + on theme(application_id) + WHERE deleted_at IS NULL; -- workspace table constraints create index if not exists workspace_tenant_id_idx - on workspace(tenant_id) - WHERE deleted_at IS NULL; + on workspace(tenant_id) + WHERE deleted_at IS NULL; create index if not exists workspace_name_idx - on workspace(name) - WHERE deleted_at IS NULL; - + on workspace(name) + WHERE deleted_at IS NULL; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V004__updateIndexes.sql b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V004__updateIndexes.sql index a7ebddef3f62..892abbbe0e71 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V004__updateIndexes.sql +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V004__updateIndexes.sql @@ -9,19 +9,19 @@ CREATE UNIQUE INDEX IF NOT EXISTS custom_js_libs_uidstring_key ON customjslib(ui -- new-action CREATE INDEX IF NOT EXISTS new_action_unpublished_datasource_id_idx - ON new_action(((unpublished_action ->> 'datasource')::jsonb ->> 'id')) - WHERE deleted_at IS NULL AND unpublished_action IS NOT NULL AND unpublished_action ->> 'datasource' IS NOT NULL; + ON new_action(((unpublished_action ->> 'datasource')::jsonb ->> 'id')) + WHERE deleted_at IS NULL AND unpublished_action IS NOT NULL AND unpublished_action ->> 'datasource' IS NOT NULL; CREATE INDEX IF NOT EXISTS new_action_published_datasource_id_idx - on new_action(((published_action ->> 'datasource')::jsonb ->> 'id')) - WHERE deleted_at IS NULL AND published_action IS NOT NULL AND published_action ->> 'datasource' IS NOT NULL; + on new_action(((published_action ->> 'datasource')::jsonb ->> 'id')) + WHERE deleted_at IS NULL AND published_action IS NOT NULL AND published_action ->> 'datasource' IS NOT NULL; -- plugin CREATE INDEX IF NOT EXISTS plugin_type_idx ON plugin (type); -- workspace CREATE INDEX IF NOT EXISTS workspace_policy_manage_workspace_tanantId_idx - ON workspace (((policy_map ->> 'manage:workspaces')::jsonb ->> 'permissionGroups'), tenant_id) - WHERE deleted_at IS NULL; + ON workspace (((policy_map ->> 'manage:workspaces')::jsonb ->> 'permissionGroups'), tenant_id) + WHERE deleted_at IS NULL; CREATE INDEX IF NOT EXISTS workspace_policy_read_workspace_tanantId_idx - ON workspace (((policy_map ->> 'read:workspaces')::jsonb ->> 'permissionGroups'), tenant_id) - WHERE deleted_at IS NULL; + ON workspace (((policy_map ->> 'read:workspaces')::jsonb ->> 'permissionGroups'), tenant_id) + WHERE deleted_at IS NULL; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V006__updateIndexesForJsonbColumns.sql b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V006__updateIndexesForJsonbColumns.sql index a52001bc5fa2..50d693840f28 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V006__updateIndexesForJsonbColumns.sql +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V006__updateIndexesForJsonbColumns.sql @@ -1,41 +1,41 @@ -- This migration updates the indexes for the JSONB columns in action_collection tables. DROP INDEX IF EXISTS action_collection_unpublished_page_id_idx; CREATE INDEX IF NOT EXISTS action_collection_unpublished_page_id_idx - ON action_collection (JSONB_EXTRACT_PATH_TEXT(unpublished_collection, 'pageId')) - WHERE deleted_at IS NULL; + ON action_collection (JSONB_EXTRACT_PATH_TEXT(unpublished_collection, 'pageId')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS action_collection_published_page_id_idx; CREATE INDEX IF NOT EXISTS action_collection_published_page_id_idx - ON action_collection (JSONB_EXTRACT_PATH_TEXT(published_collection, 'pageId')) - WHERE deleted_at IS NULL; + ON action_collection (JSONB_EXTRACT_PATH_TEXT(published_collection, 'pageId')) + WHERE deleted_at IS NULL; -- This migration updates the indexes for the JSONB columns in new_action tables. DROP INDEX IF EXISTS new_action_unpublished_page_id_idx; CREATE INDEX IF NOT EXISTS new_action_unpublished_page_id_idx - ON new_action (JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'pageId')) - WHERE deleted_at IS NULL; + ON new_action (JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'pageId')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS new_action_published_page_id_idx; CREATE INDEX IF NOT EXISTS new_action_published_page_id_idx - ON new_action (JSONB_EXTRACT_PATH_TEXT(published_action, 'pageId')) - WHERE deleted_at IS NULL; + ON new_action (JSONB_EXTRACT_PATH_TEXT(published_action, 'pageId')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS new_action_unpublished_collection_id_idx; CREATE INDEX IF NOT EXISTS new_action_unpublished_collection_id_idx - ON new_action (JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'collectionId')) - WHERE deleted_at IS NULL; + ON new_action (JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'collectionId')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS new_action_published_collection_id_idx; CREATE INDEX IF NOT EXISTS new_action_published_collection_id_idx - ON new_action (JSONB_EXTRACT_PATH_TEXT(published_action, 'collectionId')) - WHERE deleted_at IS NULL; + ON new_action (JSONB_EXTRACT_PATH_TEXT(published_action, 'collectionId')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS new_action_unpublished_datasource_id_idx; CREATE INDEX IF NOT EXISTS new_action_unpublished_datasource_id_idx - ON new_action(JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'datasource', 'id')) - WHERE deleted_at IS NULL; + ON new_action(JSONB_EXTRACT_PATH_TEXT(unpublished_action, 'datasource', 'id')) + WHERE deleted_at IS NULL; DROP INDEX IF EXISTS new_action_published_datasource_id_idx; CREATE INDEX IF NOT EXISTS new_action_published_datasource_id_idx - on new_action(JSONB_EXTRACT_PATH_TEXT(published_action, 'datasource', 'id')) - WHERE deleted_at IS NULL; + on new_action(JSONB_EXTRACT_PATH_TEXT(published_action, 'datasource', 'id')) + WHERE deleted_at IS NULL; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V007__useGINIndexForPermissionGroupIds.sql b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V007__useGINIndexForPermissionGroupIds.sql index f0123080cd96..a7036c47746d 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V007__useGINIndexForPermissionGroupIds.sql +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V007__useGINIndexForPermissionGroupIds.sql @@ -2,5 +2,5 @@ drop index if exists permission_group_user_ids_idx; create index if not exists permission_group_user_ids_idx - ON permission_group USING gin (assigned_to_user_ids jsonb_ops) - WHERE deleted_at IS NULL; + ON permission_group USING gin (assigned_to_user_ids jsonb_ops) + WHERE deleted_at IS NULL; diff --git a/app/server/appsmith-server/src/main/resources/application.properties b/app/server/appsmith-server/src/main/resources/application.properties index fd5a0ebb2b10..cb72f61fbb9d 100644 --- a/app/server/appsmith-server/src/main/resources/application.properties +++ b/app/server/appsmith-server/src/main/resources/application.properties @@ -14,7 +14,7 @@ appsmith.db.url=${APPSMITH_DB_URL:${APPSMITH_MONGODB_URI}} spring.main.allow-bean-definition-overriding=true spring.data.redis.repositories.enabled=false -# SQL statements debugging +# SQL statements debugging spring.jpa.show-sql=${APPSMITH_SHOW_SQL:false} spring.jpa.properties.hibernate.format_sql=false spring.jpa.properties.hibernate.use_sql_comments=false diff --git a/app/server/pom.xml b/app/server/pom.xml index 1bd3cba3ad89..814ba6851871 100644 --- a/app/server/pom.xml +++ b/app/server/pom.xml @@ -134,6 +134,7 @@ *.md .gitignore + **/*.sql