From 3349c6cd1d23321fe005d140f7b5fdf02291985b Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 24 Oct 2023 13:17:44 +0100 Subject: [PATCH] Undid accidental merge --- .eslintrc.js | 5 +- lib/GADS.pm | 190 +- lib/GADS/Schema.pm | 2 +- lib/GADS/Schema/Result/Layout.pm | 15 - lib/GADS/Schema/Result/Report.pm | 171 - lib/GADS/Schema/Result/ReportLayout.pm | 115 - lib/GADS/Schema/Result/Site.pm | 7 - lib/GADS/Schema/Result/User.pm | 51 +- share/fixtures/101/conf/all_tables.json | 277 - share/fixtures/101/conf/current.json | 73 - share/fixtures/101/conf/graphs.json | 17 - share/fixtures/101/conf/layout.json | 53 - share/fixtures/101/conf/permissions.json | 17 - share/fixtures/101/conf/views_global.json | 28 - .../MySQL/deploy/101/001-auto-__VERSION.sql | 18 - .../migrations/MySQL/deploy/101/001-auto.sql | 1192 --- .../MySQL/downgrade/101-100/001-auto.sql | 24 - .../MySQL/upgrade/100-101/001-auto.sql | 46 - .../deploy/101/001-auto-__VERSION.sql | 18 - .../PostgreSQL/deploy/101/001-auto.sql | 1766 ---- .../PostgreSQL/downgrade/101-100/001-auto.sql | 15 - .../PostgreSQL/upgrade/100-101/001-auto.sql | 55 - .../_source/deploy/101/001-auto-__VERSION.yml | 92 - .../_source/deploy/101/001-auto.yml | 8989 ----------------- .../components/button/lib/component.js | 6 +- .../button/lib/create-report-button.js | 108 - src/frontend/js/site.js | 4 +- views/fields/checkbox_list.tt | 13 +- views/navigation/table_header_tab_menu.tt | 5 - views/report.tt | 175 - 30 files changed, 33 insertions(+), 13514 deletions(-) delete mode 100644 lib/GADS/Schema/Result/Report.pm delete mode 100644 lib/GADS/Schema/Result/ReportLayout.pm delete mode 100644 share/fixtures/101/conf/all_tables.json delete mode 100644 share/fixtures/101/conf/current.json delete mode 100644 share/fixtures/101/conf/graphs.json delete mode 100644 share/fixtures/101/conf/layout.json delete mode 100644 share/fixtures/101/conf/permissions.json delete mode 100644 share/fixtures/101/conf/views_global.json delete mode 100644 share/migrations/MySQL/deploy/101/001-auto-__VERSION.sql delete mode 100644 share/migrations/MySQL/deploy/101/001-auto.sql delete mode 100644 share/migrations/MySQL/downgrade/101-100/001-auto.sql delete mode 100644 share/migrations/MySQL/upgrade/100-101/001-auto.sql delete mode 100644 share/migrations/PostgreSQL/deploy/101/001-auto-__VERSION.sql delete mode 100644 share/migrations/PostgreSQL/deploy/101/001-auto.sql delete mode 100644 share/migrations/PostgreSQL/downgrade/101-100/001-auto.sql delete mode 100644 share/migrations/PostgreSQL/upgrade/100-101/001-auto.sql delete mode 100644 share/migrations/_source/deploy/101/001-auto-__VERSION.yml delete mode 100644 share/migrations/_source/deploy/101/001-auto.yml delete mode 100644 src/frontend/components/button/lib/create-report-button.js delete mode 100644 views/report.tt diff --git a/.eslintrc.js b/.eslintrc.js index ea0417d17..0d0d5a57a 100755 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,10 +46,9 @@ module.exports = { 'strict': 0, 'object-shorthand': 0, 'dot-notation': 0, - 'prettier/prettier': 0, + 'prettier/prettier': 'error', 'jsdoc/require-param-description': 0, 'jsdoc/require-returns-description': 0, - 'no-unused-vars': 0, - 'no-undef': 0, }, }; + diff --git a/lib/GADS.pm b/lib/GADS.pm index 881b8da1a..27f063ceb 100644 --- a/lib/GADS.pm +++ b/lib/GADS.pm @@ -80,7 +80,7 @@ use Tie::Cache; use URI; use URI::Escape qw/uri_escape_utf8 uri_unescape/; -use Log::Log4perl; #qw(:easy); # Just for WWW::Mechanize::Chrome +use Log::Log4perl qw(:easy); # Just for WWW::Mechanize::Chrome use WWW::Mechanize::Chrome; use Dancer2; # Last to stop Moo generating conflicting namespace @@ -778,7 +778,7 @@ any ['get', 'post'] => '/myaccount/?' => require_login sub { $update{$field->{name}} = param($field->{name}) || undef; } - if (process( sub { $user->update_user(current_user => logged_in_user, edit_own_user => 1, %update) })) + if (process( sub { $user->update_user(current_user => logged_in_user, %update) })) { return forwardHome( { success => "The account details have been updated" }, 'myaccount' ); @@ -1577,6 +1577,16 @@ any ['get', 'post'] => '/user/:id' => require_any_role [qw/useradmin superadmin/ return forwardHome( { success => "User has been updated successfully" }, 'user_overview/' ); } + + # In case of failure, pass back to form + my $view_limits_with_blank = [ map { + +{ + view_id => $_ + } + } body_parameters->get_all('view_limits') ]; + + $values{view_limits_with_blank} = $view_limits_with_blank; + $editUser = \%values; } elsif (my $delete_id = param('delete')) { @@ -2752,182 +2762,6 @@ prefix '/:layout_name' => sub { template 'data' => $params; }; - prefix '/report' => sub { - - #view the report - get '' => require_login sub { - my $user = logged_in_user; - my $layout = var('layout') or pass; - - if ( app->has_hook('plugin.linkspace.data_before_request') ) { - app->execute_hook( 'plugin.linkspace.data_before_request', - user => $user ); - } - - my %params = ( - user => $user, - layout => $layout, - schema => schema, - ); - - my $records = GADS::Records->new(%params); - - my $alert = GADS::Alert->new( - user => $user, - layout => $layout, - schema => schema, - ); - - my $base_url = request->base; - - my $params; - - $params->{alerts} = $alert->all; - $params->{header_type} = 'table_tabs'; - - $params->{layout_obj} = $layout; - $params->{layout} = $layout; - - $params->{header_back_url} = "${base_url}table"; - $params->{breadcrumbs} = [ - Crumb( $base_url . "table/", "Tables" ), - Crumb( "", "Table: " . $layout->name ) - ]; - - my $reports = schema->resultset('Report')->search( - { - instance_id => $layout->instance_id, - } - ); - - my $report; - my @result; - - while ( $report = $reports->next ) { - push( - @result, - { - id => $report->id, - name => $report->name - } - ); - } - - $params->{viewtype} = 'table'; - $params->{reports} = \@result; - - template 'report' => $params; - }; - - post '/add' => require_login sub { - print STDOUT Dumper params; - - redirect '/report'; - }; - - #add a report - get '/add' => require_login sub { - - my $user = logged_in_user; - my $layout = var('layout') or pass; - - if ( app->has_hook('plugin.linkspace.data_before_request') ) { - app->execute_hook( 'plugin.linkspace.data_before_request', - user => $user ); - } - - my %params = ( - user => $user, - layout => $layout, - schema => schema, - ); - - my $records = GADS::Records->new(%params); - - my @columns = @{$records->columns_render}; - - my $fields = [ map $_->presentation( - group => $records->is_group, - group_col_ids => $records->group_col_ids, - sort => $records->sort_first, - query_parameters => query_parameters, - ), @columns ]; - - my $alert = GADS::Alert->new( - user => $user, - layout => $layout, - schema => schema, - ); - - my $base_url = request->base; - - my $params; - - $params->{alerts} = $alert->all; - $params->{header_type} = 'table_tabs'; - - $params->{layout_obj} = $layout; - $params->{layout} = $layout; - - $params->{header_back_url} = "${base_url}table"; - $params->{breadcrumbs} = [ - Crumb( $base_url . "table/", "Tables" ), - Crumb( "", "Table: " . $layout->name ) - ]; - - $params->{viewtype} = 'add'; - $params->{fields} = $fields; - - template 'report' => $params; - }; - - any ['get','post'] => '/edit:id' => require_login sub { - - #todo: We be working on this after add! - my $user = logged_in_user; - my $layout = var('layout') or pass; - - if ( app->has_hook('plugin.linkspace.data_before_request') ) { - app->execute_hook( 'plugin.linkspace.data_before_request', - user => $user ); - } - - my %params = ( - user => $user, - layout => $layout, - schema => schema, - ); - - my $records = GADS::Records->new(%params); - - my $alert = GADS::Alert->new( - user => $user, - layout => $layout, - schema => schema, - ); - - my $base_url = request->base; - - my $params; - - $params->{alerts} = $alert->all; - $params->{header_type} = 'table_tabs'; - - $params->{layout_obj} = $layout; - $params->{layout} = $layout; - - $params->{header_back_url} = "${base_url}table"; - $params->{breadcrumbs} = [ - Crumb( $base_url . "table/", "Tables" ), - Crumb( "", "Table: " . $layout->name ) - ]; - - $params->{viewtype} = 'edit'; - - template 'report' => $params; - }; - }; - # any ['get', 'post'] => qr{/tree[0-9]*/([0-9]*)/?} => require_login sub { any ['get', 'post'] => '/tree:any?/:layout_id/?' => require_login sub { # Random number can be used after "tree" to prevent caching diff --git a/lib/GADS/Schema.pm b/lib/GADS/Schema.pm index 3fc8510d8..502a3ddd8 100644 --- a/lib/GADS/Schema.pm +++ b/lib/GADS/Schema.pm @@ -8,7 +8,7 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_namespaces; -our $VERSION = 101; +our $VERSION = 100; our $IGNORE_PERMISSIONS; our $IGNORE_PERMISSIONS_SEARCH; diff --git a/lib/GADS/Schema/Result/Layout.pm b/lib/GADS/Schema/Result/Layout.pm index 286f05139..8c5dc202f 100644 --- a/lib/GADS/Schema/Result/Layout.pm +++ b/lib/GADS/Schema/Result/Layout.pm @@ -865,19 +865,4 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 report_layouts - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "report_layouts", - "GADS::Schema::Result::ReportLayout", - { "foreign.report_id" => "self.id" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - 1; diff --git a/lib/GADS/Schema/Result/Report.pm b/lib/GADS/Schema/Result/Report.pm deleted file mode 100644 index fa1da120c..000000000 --- a/lib/GADS/Schema/Result/Report.pm +++ /dev/null @@ -1,171 +0,0 @@ -use utf8; -package GADS::Schema::Result::Report; - -=head1 NAME - -GADS::Schema::Result::Report - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 COMPONENTS LOADED - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->load_components("InflateColumn::DateTime"); - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("report"); - -=head1 ACCESSORS - -=head2 id - - data_type: 'bigint' - is_auto_increment: 1 - is_nullable: 0 - -=head2 name - - data_type: 'varchar' - is_nullable: 0 - size: 128 - -=head2 user_id - - data_type: 'bigint' - is_foreign_key: 1 - is_nullable: 1 - -=head2 createby - - data_type: 'bigint' - is_foreign_key: 1 - is_nullable: 1 - -=head2 created - - data_type: 'datetime' - datetime_undef_if_invalid: 1 - is_nullable: 1 - -=head2 instance_id - - data_type: 'bigint' - is_foreign_key: 1 - is_nullable: 1 - -=cut - -__PACKAGE__->add_columns( - "id", - { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, - "name", - { data_type => "varchar", is_nullable => 0, size => 128 }, - "description", - { data_type => "varchar", is_nullable => 1, size => 128 }, - "user_id", - { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, - "createdby", - { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, - "created", - { data_type => "datetime", datetime_undef_if_invalid => 1, is_nullable => 1 }, - "instance_id", - { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("id"); - -=head1 RELATIONS - -=head2 user - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "user", - "GADS::Schema::Result::User", - { id => "user_id" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "NO ACTION", - on_update => "NO ACTION" - }, -); - -__PACKAGE__->belongs_to( - "createdby", - "GADS::Schema::Result::User", - { id => "createdby" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "NO ACTION", - on_update => "NO ACTION" - }, -); - -=head2 instance - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "instance", - "GADS::Schema::Result::Instance", - { id => "instance_id" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "NO ACTION", - on_update => "NO ACTION" - }, -); - -=head2 report_layouts - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "report_layouts", - "GADS::Schema::Result::ReportLayout", - { "foreign.report_id" => "self.id" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - -1; \ No newline at end of file diff --git a/lib/GADS/Schema/Result/ReportLayout.pm b/lib/GADS/Schema/Result/ReportLayout.pm deleted file mode 100644 index 36b9b7e8f..000000000 --- a/lib/GADS/Schema/Result/ReportLayout.pm +++ /dev/null @@ -1,115 +0,0 @@ -use utf8; -package GADS::Schema::Result::ReportLayout; - -=head1 NAME - -GADS::Schema::Result::ReportLayout - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 COMPONENTS LOADED - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->load_components("InflateColumn::DateTime"); - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("report_instance"); - -=head1 ACCESSORS - -=head2 id - - data_type: 'integer' - is_auto_increment: 1 - is_nullable: 0 - -=head2 report_id - - data_type: 'integer' - is_foreign_key: 1 - is_nullable: 0 - -=head2 instance_id - - data_type: 'bigint' - is_foreign_key: 1 - is_nullable: 0 - -=head2 order - - data_type: 'integer' - is_nullable: 1 - -=cut - -__PACKAGE__->add_columns( - "id", - { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, - "report_id", - { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "layout_id", - { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, - "order", - { data_type => "integer", is_nullable => 1 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("id"); - -=head1 RELATIONS - -=head2 layout - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "report", - "GADS::Schema::Result::Report", - { id => "report_id" }, - { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" }, -); - -=head2 view - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "layout", - "GADS::Schema::Result::Layout", - { id => "layout_id" }, - { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" }, -); - -1; diff --git a/lib/GADS/Schema/Result/Site.pm b/lib/GADS/Schema/Result/Site.pm index f561b7c94..bf1dd841a 100644 --- a/lib/GADS/Schema/Result/Site.pm +++ b/lib/GADS/Schema/Result/Site.pm @@ -241,13 +241,6 @@ sub user_fields_as_string join ', ', map $_->{description}, $self->user_fields; } -sub user_field_is_editable { - my $self = shift; - my $field = shift; - - !!grep { $_->{name} eq $field && $_->{editable} } $self->user_fields(); -} - sub user_fields { my $self = shift; diff --git a/lib/GADS/Schema/Result/User.pm b/lib/GADS/Schema/Result/User.pm index 41ebef520..3158ce696 100644 --- a/lib/GADS/Schema/Result/User.pm +++ b/lib/GADS/Schema/Result/User.pm @@ -728,14 +728,9 @@ sub sqlt_deploy_hook { } # Used to ensure an empty selector is available in the user edit page -has view_limits_with_blank => ( - is => 'lazy', - clearer => 1, -); - -sub _build_view_limits_with_blank +sub view_limits_with_blank { my $self = shift; - return [$self->view_limits->all] if $self->view_limits->count; + return $self->view_limits if $self->view_limits->count; return [undef]; } @@ -756,10 +751,6 @@ sub set_view_limits '!=' => [ -and => @view_ids ] } if @view_ids; $self->search_related('view_limits', $search)->delete; - # Rebuild view limits in case of form submission failures (see same - # comments as permissions0 - $self->clear_view_limits_with_blank; - $self->view_limits_with_blank; } sub graphs @@ -869,6 +860,15 @@ sub update_user my $site = $self->result_source->schema->resultset('Site')->next; + error __x"Please select a {name} for the user", name => $site->organisation_name + if !$params{organisation} && $site->register_organisation_mandatory; + + error __x"Please select a {name} for the user", name => $site->team_name + if !$params{team_id} && $site->register_team_mandatory; + + error __x"Please select a {name} for the user", name => $site->department_name + if !$params{department_id} && $site->register_department_mandatory; + my $values = { account_request_notes => $params{account_request_notes}, }; @@ -880,10 +880,9 @@ sub update_user foreach my $field ($site->user_fields) { next if !exists $params{$field->{name}}; - my $fname = $field->{name}; - $self->$fname($params{$fname}); - $self->username($params{email}) - if $fname eq 'email'; + $values->{$field->{name}} = $params{$field->{name}}; + $values->{username} = $params{email} + if $field->{name} eq 'email'; } my $audit = GADS::Audit->new(schema => $self->result_source->schema, user => $current_user); @@ -918,32 +917,10 @@ sub update_user error __"You do not have permission to set global user permissions" if !$current_user->permission->{superadmin}; $self->permissions(@{$params{permissions}}); - # Clear and rebuild permissions, in case of form submission failure. We - # need to rebuild now, otherwise the transaction may have rolled-back - # to the old version by the time it is built in the template - $self->clear_permission; - $self->permission; } $self->set_view_limits($params{view_limits}) if $params{view_limits}; - my $empty = 1; - $empty = 0 if($params{organisation}); - - my $required = 0; - $required = 1 if $site->register_organisation_mandatory; - $required = 0 if $params{edit_own_user}; - $required = 1 if $params{$site->user_field_is_editable('organisation')}; - - error __x"Please select a {name} for the user", name => $site->organisation_name - if $empty && $required; - - error __x"Please select a {name} for the user", name => $site->team_name - if !$params{team_id} && $site->register_team_mandatory; - - error __x"Please select a {name} for the user", name => $site->department_name - if !$params{department_id} && $site->register_department_mandatory; - my $msg = __x"User updated: ID {id}, username: {username}", id => $self->id, username => $params{username}; $msg .= __x", groups: {groups}", groups => join ', ', @{$params{groups}} diff --git a/share/fixtures/101/conf/all_tables.json b/share/fixtures/101/conf/all_tables.json deleted file mode 100644 index 587891f7f..000000000 --- a/share/fixtures/101/conf/all_tables.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "belongs_to" : { - "fetch" : 0 - }, - "might_have" : { - "fetch" : 0 - }, - "sets" : [ - { - "quantity" : "all", - "class" : "InstanceRag" - }, - { - "quantity" : "all", - "class" : "Group" - }, - { - "quantity" : "all", - "class" : "UserPermission" - }, - { - "class" : "Fileval", - "quantity" : "all" - }, - { - "class" : "Record", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Audit" - }, - { - "class" : "Curval", - "quantity" : "all" - }, - { - "class" : "Report", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "GraphColor" - }, - { - "quantity" : "all", - "class" : "UserGraph" - }, - { - "quantity" : "all", - "class" : "Rag" - }, - { - "class" : "LayoutDepend", - "quantity" : "all" - }, - { - "class" : "Enum", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "FilteredValue" - }, - { - "quantity" : "all", - "class" : "Changed" - }, - { - "class" : "ImportRow", - "quantity" : "all" - }, - { - "class" : "UserGroup", - "quantity" : "all" - }, - { - "class" : "Import", - "quantity" : "all" - }, - { - "class" : "Sort", - "quantity" : "all" - }, - { - "class" : "DisplayField", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Person" - }, - { - "class" : "String", - "quantity" : "all" - }, - { - "class" : "Ragval", - "quantity" : "all" - }, - { - "class" : "FileOption", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Department" - }, - { - "quantity" : "all", - "class" : "Current" - }, - { - "class" : "Authentication", - "quantity" : "all" - }, - { - "class" : "Widget", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "ViewLayout" - }, - { - "quantity" : "all", - "class" : "ViewGroup" - }, - { - "class" : "ReportLayout", - "quantity" : "all" - }, - { - "class" : "Team", - "quantity" : "all" - }, - { - "class" : "Submission", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Permission" - }, - { - "quantity" : "all", - "class" : "Calc" - }, - { - "class" : "Date", - "quantity" : "all" - }, - { - "class" : "File", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Alert" - }, - { - "quantity" : "all", - "class" : "User" - }, - { - "quantity" : "all", - "class" : "Daterange" - }, - { - "class" : "Title", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Oauthtoken" - }, - { - "class" : "Graph", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Dashboard" - }, - { - "quantity" : "all", - "class" : "Enumval" - }, - { - "quantity" : "all", - "class" : "Export" - }, - { - "class" : "Topic", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Oauthclient" - }, - { - "class" : "UserLastrecord", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "AlertCache" - }, - { - "quantity" : "all", - "class" : "View" - }, - { - "class" : "LayoutGroup", - "quantity" : "all" - }, - { - "class" : "Metric", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Instance" - }, - { - "class" : "Layout", - "quantity" : "all" - }, - { - "class" : "MetricGroup", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "AlertSend" - }, - { - "quantity" : "all", - "class" : "ViewLimit" - }, - { - "quantity" : "all", - "class" : "InstanceGroup" - }, - { - "quantity" : "all", - "class" : "Site" - }, - { - "quantity" : "all", - "class" : "Filter" - }, - { - "class" : "AlertColumn", - "quantity" : "all" - }, - { - "class" : "CurvalField", - "quantity" : "all" - }, - { - "class" : "Calcval", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Intgr" - }, - { - "quantity" : "all", - "class" : "Organisation" - } - ], - "has_many" : { - "fetch" : 0 - } -} diff --git a/share/fixtures/101/conf/current.json b/share/fixtures/101/conf/current.json deleted file mode 100644 index 9fb298aae..000000000 --- a/share/fixtures/101/conf/current.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "has_many" : { - "fetch" : 0 - }, - "might_have" : { - "fetch" : 0 - }, - "belongs_to" : { - "fetch" : 0 - }, - "sets" : [ - { - "class" : "Current", - "fetch" : [ - { - "rel": "records", - "quantity": "all", - "fetch": [ - { - "rel": "calcvals", - "quantity": "all" - }, - { - "rel": "curvals", - "quantity": "all" - }, - { - "rel": "dateranges", - "quantity": "all" - }, - { - "rel": "dates", - "quantity": "all" - }, - { - "rel": "enums", - "quantity": "all" - }, - { - "rel": "files", - "quantity": "all", - "fetch": [ - { - "rel": "value", - "quantity": "all" - } - ] - }, - { - "rel": "intgrs", - "quantity": "all" - }, - { - "rel": "people", - "quantity": "all" - }, - { - "rel": "ragvals", - "quantity": "all" - }, - { - "rel": "strings", - "quantity": "all" - } - ] - } - ], - "ids" : [ - "1766" - ] - } - ] -} diff --git a/share/fixtures/101/conf/graphs.json b/share/fixtures/101/conf/graphs.json deleted file mode 100644 index 6e742f676..000000000 --- a/share/fixtures/101/conf/graphs.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "has_many" : { - "fetch" : 0 - }, - "might_have" : { - "fetch" : 0 - }, - "belongs_to" : { - "fetch" : 0 - }, - "sets" : [ - { - "class" : "Graph", - "quantity" : "all" - } - ] -} diff --git a/share/fixtures/101/conf/layout.json b/share/fixtures/101/conf/layout.json deleted file mode 100644 index 557c20279..000000000 --- a/share/fixtures/101/conf/layout.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "has_many" : { - "fetch" : 0 - }, - "might_have" : { - "fetch" : 0 - }, - "belongs_to" : { - "fetch" : 0 - }, - "sets" : [ - { - "class" : "Calc", - "quantity" : "all" - }, - { - "class" : "Enumval", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "CurvalField" - }, - { - "class" : "Instance", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "LayoutGroup" - }, - { - "class" : "Layout", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "FileOption" - }, - { - "quantity" : "all", - "class" : "LayoutDepend" - }, - { - "class" : "Rag", - "quantity" : "all" - }, - { - "quantity" : "all", - "class" : "Group" - } - ] -} diff --git a/share/fixtures/101/conf/permissions.json b/share/fixtures/101/conf/permissions.json deleted file mode 100644 index c55636c86..000000000 --- a/share/fixtures/101/conf/permissions.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "might_have" : { - "fetch" : 0 - }, - "belongs_to" : { - "fetch" : 0 - }, - "has_many" : { - "fetch" : 0 - }, - "sets" : [ - { - "class" : "Permission", - "quantity" : "all" - } - ] -} diff --git a/share/fixtures/101/conf/views_global.json b/share/fixtures/101/conf/views_global.json deleted file mode 100644 index 7a675dce7..000000000 --- a/share/fixtures/101/conf/views_global.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "has_many" : { - "fetch" : 0 - }, - "might_have" : { - "fetch" : 0 - }, - "belongs_to" : { - "fetch" : 0 - }, - "sets" : [ - { - "class" : "View", - "quantity" : "all", - "cond": { "global": 1 }, - "fetch": [ - { - "rel": "view_layouts", - "quantity": "all" - }, - { - "rel": "sorts", - "quantity": "all" - } - ] - } - ] -} diff --git a/share/migrations/MySQL/deploy/101/001-auto-__VERSION.sql b/share/migrations/MySQL/deploy/101/001-auto-__VERSION.sql deleted file mode 100644 index 1d2da578d..000000000 --- a/share/migrations/MySQL/deploy/101/001-auto-__VERSION.sql +++ /dev/null @@ -1,18 +0,0 @@ --- --- Created by SQL::Translator::Producer::MySQL --- Created on Tue Oct 24 10:06:40 2023 --- -; -SET foreign_key_checks=0; --- --- Table: `dbix_class_deploymenthandler_versions` --- -CREATE TABLE `dbix_class_deploymenthandler_versions` ( - `id` integer NOT NULL auto_increment, - `version` varchar(50) NOT NULL, - `ddl` text NULL, - `upgrade_sql` text NULL, - PRIMARY KEY (`id`), - UNIQUE `dbix_class_deploymenthandler_versions_version` (`version`) -); -SET foreign_key_checks=1; diff --git a/share/migrations/MySQL/deploy/101/001-auto.sql b/share/migrations/MySQL/deploy/101/001-auto.sql deleted file mode 100644 index 7746aeec8..000000000 --- a/share/migrations/MySQL/deploy/101/001-auto.sql +++ /dev/null @@ -1,1192 +0,0 @@ --- --- Created by SQL::Translator::Producer::MySQL --- Created on Tue Oct 24 10:06:39 2023 --- -; -SET foreign_key_checks=0; --- --- Table: `alert` --- -CREATE TABLE `alert` ( - `id` integer NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `user_id` bigint NOT NULL, - `frequency` integer NOT NULL DEFAULT 0, - INDEX `alert_idx_user_id` (`user_id`), - INDEX `alert_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `alert_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `alert_cache` --- -CREATE TABLE `alert_cache` ( - `id` bigint NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `view_id` bigint NOT NULL, - `current_id` bigint NOT NULL, - `user_id` bigint NULL, - INDEX `alert_cache_idx_current_id` (`current_id`), - INDEX `alert_cache_idx_layout_id` (`layout_id`), - INDEX `alert_cache_idx_user_id` (`user_id`), - INDEX `alert_cache_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `alert_cache_fk_current_id` FOREIGN KEY (`current_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_cache_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_cache_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_cache_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `alert_column` --- -CREATE TABLE `alert_column` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `instance_id` integer NOT NULL, - INDEX `alert_column_idx_instance_id` (`instance_id`), - INDEX `alert_column_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `alert_column_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_column_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `alert_send` --- -CREATE TABLE `alert_send` ( - `id` bigint NOT NULL auto_increment, - `layout_id` integer NULL, - `alert_id` integer NOT NULL, - `current_id` bigint NOT NULL, - `status` char(7) NULL, - INDEX `alert_send_idx_alert_id` (`alert_id`), - INDEX `alert_send_idx_current_id` (`current_id`), - INDEX `alert_send_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - UNIQUE `alert_send_all` (`layout_id`, `alert_id`, `current_id`, `status`), - CONSTRAINT `alert_send_fk_alert_id` FOREIGN KEY (`alert_id`) REFERENCES `alert` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_send_fk_current_id` FOREIGN KEY (`current_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `alert_send_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `audit` --- -CREATE TABLE `audit` ( - `id` bigint NOT NULL auto_increment, - `site_id` integer NULL, - `user_id` bigint NULL, - `type` varchar(45) NULL, - `datetime` datetime NULL, - `method` varchar(45) NULL, - `url` text NULL, - `description` text NULL, - `instance_id` integer NULL, - INDEX `audit_idx_instance_id` (`instance_id`), - INDEX `audit_idx_site_id` (`site_id`), - INDEX `audit_idx_user_id` (`user_id`), - INDEX `audit_idx_datetime` (`datetime`), - PRIMARY KEY (`id`), - CONSTRAINT `audit_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `audit_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `audit_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `authentication` --- -CREATE TABLE `authentication` ( - `id` bigint NOT NULL auto_increment, - `site_id` integer NULL, - `type` varchar(32) NULL, - `name` text NULL, - `xml` text NULL, - `saml2_firstname` text NULL, - `saml2_surname` text NULL, - `enabled` smallint NOT NULL DEFAULT 0, - `error_messages` text NULL, - INDEX `authentication_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `authentication_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `calc` --- -CREATE TABLE `calc` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NULL, - `calc` mediumtext NULL, - `code` mediumtext NULL, - `return_format` varchar(45) NULL, - `decimal_places` smallint NULL, - INDEX `calc_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `calc_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `calcval` --- -CREATE TABLE `calcval` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `value_text` text NULL, - `value_int` bigint NULL, - `value_date` date NULL, - `value_numeric` decimal(20, 5) NULL, - `value_date_from` datetime NULL, - `value_date_to` datetime NULL, - INDEX `calcval_idx_layout_id` (`layout_id`), - INDEX `calcval_idx_record_id` (`record_id`), - INDEX `calcval_idx_value_text` (`value_text`(64)), - INDEX `calcval_idx_value_numeric` (`value_numeric`), - INDEX `calcval_idx_value_int` (`value_int`), - INDEX `calcval_idx_value_date` (`value_date`), - PRIMARY KEY (`id`), - CONSTRAINT `calcval_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `calcval_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `current` --- -CREATE TABLE `current` ( - `id` bigint NOT NULL auto_increment, - `serial` bigint NULL, - `parent_id` bigint NULL, - `instance_id` integer NULL, - `linked_id` bigint NULL, - `deleted` datetime NULL, - `deletedby` bigint NULL, - `draftuser_id` bigint NULL, - INDEX `current_idx_deletedby` (`deletedby`), - INDEX `current_idx_draftuser_id` (`draftuser_id`), - INDEX `current_idx_instance_id` (`instance_id`), - INDEX `current_idx_linked_id` (`linked_id`), - INDEX `current_idx_parent_id` (`parent_id`), - PRIMARY KEY (`id`), - UNIQUE `current_ux_instance_serial` (`instance_id`, `serial`), - CONSTRAINT `current_fk_deletedby` FOREIGN KEY (`deletedby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `current_fk_draftuser_id` FOREIGN KEY (`draftuser_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `current_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `current_fk_linked_id` FOREIGN KEY (`linked_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `current_fk_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `curval` --- -CREATE TABLE `curval` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NULL, - `layout_id` integer NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` bigint NULL, - INDEX `curval_idx_layout_id` (`layout_id`), - INDEX `curval_idx_record_id` (`record_id`), - INDEX `curval_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `curval_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `curval_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `curval_fk_value` FOREIGN KEY (`value`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `curval_fields` --- -CREATE TABLE `curval_fields` ( - `id` integer NOT NULL auto_increment, - `parent_id` integer NOT NULL, - `child_id` integer NOT NULL, - INDEX `curval_fields_idx_child_id` (`child_id`), - INDEX `curval_fields_idx_parent_id` (`parent_id`), - PRIMARY KEY (`id`), - CONSTRAINT `curval_fields_fk_child_id` FOREIGN KEY (`child_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `curval_fields_fk_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `dashboard` --- -CREATE TABLE `dashboard` ( - `id` integer NOT NULL auto_increment, - `site_id` integer NULL, - `instance_id` integer NULL, - `user_id` integer NULL, - INDEX `dashboard_idx_instance_id` (`instance_id`), - INDEX `dashboard_idx_site_id` (`site_id`), - INDEX `dashboard_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `dashboard_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `dashboard_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `dashboard_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `date` --- -CREATE TABLE `date` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` date NULL, - INDEX `date_idx_layout_id` (`layout_id`), - INDEX `date_idx_record_id` (`record_id`), - INDEX `date_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `date_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `date_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `daterange` --- -CREATE TABLE `daterange` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `from` date NULL, - `to` date NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` varchar(45) NULL, - INDEX `daterange_idx_layout_id` (`layout_id`), - INDEX `daterange_idx_record_id` (`record_id`), - INDEX `daterange_idx_from` (`from`), - INDEX `daterange_idx_to` (`to`), - INDEX `daterange_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `daterange_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `daterange_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `department` --- -CREATE TABLE `department` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NULL, - `site_id` integer NULL, - `deleted` smallint NOT NULL DEFAULT 0, - INDEX `department_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `department_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `display_field` --- -CREATE TABLE `display_field` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `display_field_id` integer NOT NULL, - `regex` text NULL, - `operator` varchar(16) NULL, - INDEX `display_field_idx_display_field_id` (`display_field_id`), - INDEX `display_field_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `display_field_fk_display_field_id` FOREIGN KEY (`display_field_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `display_field_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `enum` --- -CREATE TABLE `enum` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NULL, - `layout_id` integer NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` integer NULL, - INDEX `enum_idx_layout_id` (`layout_id`), - INDEX `enum_idx_record_id` (`record_id`), - INDEX `enum_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `enum_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `enum_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `enum_fk_value` FOREIGN KEY (`value`) REFERENCES `enumval` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `enumval` --- -CREATE TABLE `enumval` ( - `id` integer NOT NULL auto_increment, - `value` text NULL, - `layout_id` integer NULL, - `deleted` smallint NOT NULL DEFAULT 0, - `parent` integer NULL, - `position` integer NULL, - INDEX `enumval_idx_layout_id` (`layout_id`), - INDEX `enumval_idx_parent` (`parent`), - INDEX `enumval_idx_value` (`value`(64)), - PRIMARY KEY (`id`), - CONSTRAINT `enumval_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `enumval_fk_parent` FOREIGN KEY (`parent`) REFERENCES `enumval` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `export` --- -CREATE TABLE `export` ( - `id` integer NOT NULL auto_increment, - `site_id` integer NULL, - `user_id` bigint NOT NULL, - `type` varchar(45) NULL, - `started` datetime NULL, - `completed` datetime NULL, - `result` text NULL, - `result_internal` text NULL, - `mimetype` text NULL, - `content` longblob NULL, - INDEX `export_idx_site_id` (`site_id`), - INDEX `export_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `export_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `export_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `file` --- -CREATE TABLE `file` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NULL, - `layout_id` integer NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` bigint NULL, - INDEX `file_idx_layout_id` (`layout_id`), - INDEX `file_idx_record_id` (`record_id`), - INDEX `file_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `file_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `file_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `file_fk_value` FOREIGN KEY (`value`) REFERENCES `fileval` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `file_option` --- -CREATE TABLE `file_option` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `filesize` integer NULL, - INDEX `file_option_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `file_option_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `fileval` --- -CREATE TABLE `fileval` ( - `id` bigint NOT NULL auto_increment, - `name` text NULL, - `mimetype` text NULL, - `content` longblob NULL, - `is_independent` smallint NOT NULL DEFAULT 0, - `edit_user_id` bigint NULL, - INDEX `fileval_idx_edit_user_id` (`edit_user_id`), - INDEX `fileval_idx_name` (`name`(64)), - PRIMARY KEY (`id`), - CONSTRAINT `fileval_fk_edit_user_id` FOREIGN KEY (`edit_user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `filter` --- -CREATE TABLE `filter` ( - `id` bigint NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - INDEX `filter_idx_layout_id` (`layout_id`), - INDEX `filter_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `filter_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `filter_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `filtered_value` --- -CREATE TABLE `filtered_value` ( - `id` integer NOT NULL auto_increment, - `submission_id` integer NULL, - `layout_id` integer NULL, - `current_id` integer NULL, - INDEX `filtered_value_idx_current_id` (`current_id`), - INDEX `filtered_value_idx_layout_id` (`layout_id`), - INDEX `filtered_value_idx_submission_id` (`submission_id`), - PRIMARY KEY (`id`), - UNIQUE `ux_submission_layout_current` (`submission_id`, `layout_id`, `current_id`), - CONSTRAINT `filtered_value_fk_current_id` FOREIGN KEY (`current_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `filtered_value_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `filtered_value_fk_submission_id` FOREIGN KEY (`submission_id`) REFERENCES `submission` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `graph` --- -CREATE TABLE `graph` ( - `id` integer NOT NULL auto_increment, - `title` text NULL, - `description` text NULL, - `y_axis` integer NULL, - `y_axis_stack` varchar(45) NULL, - `y_axis_label` text NULL, - `x_axis` integer NULL, - `x_axis_link` integer NULL, - `x_axis_grouping` varchar(45) NULL, - `group_by` integer NULL, - `stackseries` smallint NOT NULL DEFAULT 0, - `as_percent` smallint NOT NULL DEFAULT 0, - `type` varchar(45) NULL, - `metric_group` integer NULL, - `instance_id` integer NULL, - `is_shared` smallint NOT NULL DEFAULT 0, - `user_id` bigint NULL, - `group_id` integer NULL, - `trend` varchar(45) NULL, - `from` date NULL, - `to` date NULL, - `x_axis_range` varchar(45) NULL, - INDEX `graph_idx_group_id` (`group_id`), - INDEX `graph_idx_group_by` (`group_by`), - INDEX `graph_idx_instance_id` (`instance_id`), - INDEX `graph_idx_metric_group` (`metric_group`), - INDEX `graph_idx_user_id` (`user_id`), - INDEX `graph_idx_x_axis` (`x_axis`), - INDEX `graph_idx_x_axis_link` (`x_axis_link`), - INDEX `graph_idx_y_axis` (`y_axis`), - PRIMARY KEY (`id`), - CONSTRAINT `graph_fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_group_by` FOREIGN KEY (`group_by`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_metric_group` FOREIGN KEY (`metric_group`) REFERENCES `metric_group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_x_axis` FOREIGN KEY (`x_axis`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_x_axis_link` FOREIGN KEY (`x_axis_link`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `graph_fk_y_axis` FOREIGN KEY (`y_axis`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `graph_color` --- -CREATE TABLE `graph_color` ( - `id` bigint NOT NULL auto_increment, - `name` varchar(128) NULL, - `color` char(6) NULL, - PRIMARY KEY (`id`), - UNIQUE `ux_graph_color_name` (`name`) -); --- --- Table: `group` --- -CREATE TABLE `group` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NULL, - `default_read` smallint NOT NULL DEFAULT 0, - `default_write_new` smallint NOT NULL DEFAULT 0, - `default_write_existing` smallint NOT NULL DEFAULT 0, - `default_approve_new` smallint NOT NULL DEFAULT 0, - `default_approve_existing` smallint NOT NULL DEFAULT 0, - `default_write_new_no_approval` smallint NOT NULL DEFAULT 0, - `default_write_existing_no_approval` smallint NOT NULL DEFAULT 0, - `site_id` integer NULL, - INDEX `group_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `group_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `import` --- -CREATE TABLE `import` ( - `id` integer NOT NULL auto_increment, - `site_id` integer NULL, - `instance_id` integer NULL, - `user_id` bigint NOT NULL, - `type` varchar(45) NULL, - `row_count` integer NOT NULL DEFAULT 0, - `started` datetime NULL, - `completed` datetime NULL, - `written_count` integer NOT NULL DEFAULT 0, - `error_count` integer NOT NULL DEFAULT 0, - `skipped_count` integer NOT NULL DEFAULT 0, - `result` text NULL, - INDEX `import_idx_instance_id` (`instance_id`), - INDEX `import_idx_site_id` (`site_id`), - INDEX `import_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `import_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `import_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `import_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `import_row` --- -CREATE TABLE `import_row` ( - `id` bigint NOT NULL auto_increment, - `import_id` integer NOT NULL, - `status` varchar(45) NULL, - `content` text NULL, - `errors` text NULL, - `changes` text NULL, - INDEX `import_row_idx_import_id` (`import_id`), - PRIMARY KEY (`id`), - CONSTRAINT `import_row_fk_import_id` FOREIGN KEY (`import_id`) REFERENCES `import` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `instance` --- -CREATE TABLE `instance` ( - `id` integer NOT NULL auto_increment, - `name` text NULL, - `name_short` varchar(64) NULL, - `site_id` integer NULL, - `sort_layout_id` integer NULL, - `sort_type` varchar(45) NULL, - `view_limit_id` integer NULL, - `default_view_limit_extra_id` integer NULL, - `homepage_text` text NULL, - `homepage_text2` text NULL, - `record_name` text NULL, - `forget_history` smallint NULL DEFAULT 0, - `no_overnight_update` smallint NULL DEFAULT 0, - `api_index_layout_id` integer NULL, - `forward_record_after_create` smallint NULL DEFAULT 0, - `no_hide_blank` smallint NOT NULL DEFAULT 0, - `no_download_pdf` smallint NOT NULL DEFAULT 0, - `no_copy_record` smallint NOT NULL DEFAULT 0, - `hide_in_selector` smallint NOT NULL DEFAULT 0, - INDEX `instance_idx_api_index_layout_id` (`api_index_layout_id`), - INDEX `instance_idx_default_view_limit_extra_id` (`default_view_limit_extra_id`), - INDEX `instance_idx_site_id` (`site_id`), - INDEX `instance_idx_sort_layout_id` (`sort_layout_id`), - INDEX `instance_idx_view_limit_id` (`view_limit_id`), - PRIMARY KEY (`id`), - CONSTRAINT `instance_fk_api_index_layout_id` FOREIGN KEY (`api_index_layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `instance_fk_default_view_limit_extra_id` FOREIGN KEY (`default_view_limit_extra_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `instance_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `instance_fk_sort_layout_id` FOREIGN KEY (`sort_layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `instance_fk_view_limit_id` FOREIGN KEY (`view_limit_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `instance_group` --- -CREATE TABLE `instance_group` ( - `id` integer NOT NULL auto_increment, - `instance_id` integer NOT NULL, - `group_id` integer NOT NULL, - `permission` varchar(45) NOT NULL, - INDEX `instance_group_idx_group_id` (`group_id`), - INDEX `instance_group_idx_instance_id` (`instance_id`), - PRIMARY KEY (`id`), - UNIQUE `instance_group_ux_instance_group_permission` (`instance_id`, `group_id`, `permission`), - CONSTRAINT `instance_group_fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `instance_group_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `instance_rag` --- -CREATE TABLE `instance_rag` ( - `id` integer NOT NULL auto_increment, - `instance_id` integer NOT NULL, - `rag` varchar(16) NOT NULL, - `enabled` smallint NOT NULL DEFAULT 0, - `description` text NULL, - INDEX `instance_rag_idx_instance_id` (`instance_id`), - PRIMARY KEY (`id`), - UNIQUE `instance_rag_ux_instance_rag` (`instance_id`, `rag`), - CONSTRAINT `instance_rag_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `intgr` --- -CREATE TABLE `intgr` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` bigint NULL, - INDEX `intgr_idx_layout_id` (`layout_id`), - INDEX `intgr_idx_record_id` (`record_id`), - INDEX `intgr_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `intgr_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `intgr_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `layout` --- -CREATE TABLE `layout` ( - `id` integer NOT NULL auto_increment, - `name` text NULL, - `name_short` varchar(64) NULL, - `type` varchar(45) NULL, - `permission` integer NOT NULL DEFAULT 0, - `optional` smallint NOT NULL DEFAULT 0, - `remember` smallint NOT NULL DEFAULT 0, - `isunique` smallint NOT NULL DEFAULT 0, - `textbox` smallint NOT NULL DEFAULT 0, - `typeahead` smallint NOT NULL DEFAULT 0, - `force_regex` text NULL, - `position` integer NULL, - `ordering` varchar(45) NULL, - `end_node_only` smallint NOT NULL DEFAULT 0, - `multivalue` smallint NOT NULL DEFAULT 0, - `can_child` smallint NOT NULL DEFAULT 0, - `internal` smallint NOT NULL DEFAULT 0, - `description` text NULL, - `helptext` text NULL, - `options` text NULL, - `display_field` integer NULL, - `display_regex` text NULL, - `display_condition` char(3) NULL, - `display_matchtype` text NULL, - `instance_id` integer NULL, - `link_parent` integer NULL, - `related_field` integer NULL, - `width` integer NOT NULL DEFAULT 50, - `filter` text NULL, - `topic_id` integer NULL, - `aggregate` varchar(45) NULL, - `group_display` varchar(45) NULL, - `lookup_endpoint` text NULL, - `lookup_group` smallint NULL, - INDEX `layout_idx_display_field` (`display_field`), - INDEX `layout_idx_instance_id` (`instance_id`), - INDEX `layout_idx_link_parent` (`link_parent`), - INDEX `layout_idx_related_field` (`related_field`), - INDEX `layout_idx_topic_id` (`topic_id`), - PRIMARY KEY (`id`), - UNIQUE `layout_ux_instance_name_short` (`instance_id`, `name_short`), - CONSTRAINT `layout_fk_display_field` FOREIGN KEY (`display_field`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_fk_link_parent` FOREIGN KEY (`link_parent`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_fk_related_field` FOREIGN KEY (`related_field`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_fk_topic_id` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `layout_depend` --- -CREATE TABLE `layout_depend` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `depends_on` integer NOT NULL, - INDEX `layout_depend_idx_depends_on` (`depends_on`), - INDEX `layout_depend_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `layout_depend_fk_depends_on` FOREIGN KEY (`depends_on`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_depend_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `layout_group` --- -CREATE TABLE `layout_group` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `group_id` integer NOT NULL, - `permission` varchar(45) NOT NULL, - INDEX `layout_group_idx_group_id` (`group_id`), - INDEX `layout_group_idx_layout_id` (`layout_id`), - INDEX `layout_group_idx_permission` (`permission`), - PRIMARY KEY (`id`), - UNIQUE `layout_group_ux_layout_group_permission` (`layout_id`, `group_id`, `permission`), - CONSTRAINT `layout_group_fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `layout_group_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `metric` --- -CREATE TABLE `metric` ( - `id` integer NOT NULL auto_increment, - `metric_group` integer NOT NULL, - `x_axis_value` text NULL, - `target` bigint NULL, - `y_axis_grouping_value` text NULL, - INDEX `metric_idx_metric_group` (`metric_group`), - PRIMARY KEY (`id`), - CONSTRAINT `metric_fk_metric_group` FOREIGN KEY (`metric_group`) REFERENCES `metric_group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `metric_group` --- -CREATE TABLE `metric_group` ( - `id` integer NOT NULL auto_increment, - `name` text NULL, - `instance_id` integer NULL, - INDEX `metric_group_idx_instance_id` (`instance_id`), - PRIMARY KEY (`id`), - CONSTRAINT `metric_group_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `oauthclient` --- -CREATE TABLE `oauthclient` ( - `id` bigint NOT NULL auto_increment, - `client_id` varchar(64) NOT NULL, - `client_secret` varchar(64) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB; --- --- Table: `oauthtoken` --- -CREATE TABLE `oauthtoken` ( - `token` varchar(128) NOT NULL, - `related_token` varchar(128) NOT NULL, - `oauthclient_id` integer NOT NULL, - `user_id` bigint NOT NULL, - `type` varchar(12) NOT NULL, - `expires` integer NULL, - INDEX `oauthtoken_idx_oauthclient_id` (`oauthclient_id`), - INDEX `oauthtoken_idx_user_id` (`user_id`), - PRIMARY KEY (`token`), - CONSTRAINT `oauthtoken_fk_oauthclient_id` FOREIGN KEY (`oauthclient_id`) REFERENCES `oauthclient` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `oauthtoken_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `organisation` --- -CREATE TABLE `organisation` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NULL, - `site_id` integer NULL, - `deleted` smallint NOT NULL DEFAULT 0, - INDEX `organisation_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `organisation_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `permission` --- -CREATE TABLE `permission` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NOT NULL, - `description` text NULL, - `order` integer NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB; --- --- Table: `person` --- -CREATE TABLE `person` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NULL, - `layout_id` integer NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` bigint NULL, - INDEX `person_idx_layout_id` (`layout_id`), - INDEX `person_idx_record_id` (`record_id`), - INDEX `person_idx_value` (`value`), - PRIMARY KEY (`id`), - CONSTRAINT `person_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `person_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `person_fk_value` FOREIGN KEY (`value`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `rag` --- -CREATE TABLE `rag` ( - `id` integer NOT NULL auto_increment, - `layout_id` integer NOT NULL, - `red` text NULL, - `amber` text NULL, - `green` text NULL, - `code` mediumtext NULL, - INDEX `rag_idx_layout_id` (`layout_id`), - PRIMARY KEY (`id`), - CONSTRAINT `rag_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `ragval` --- -CREATE TABLE `ragval` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `value` varchar(16) NULL, - INDEX `ragval_idx_layout_id` (`layout_id`), - INDEX `ragval_idx_record_id` (`record_id`), - INDEX `ragval_idx_value` (`value`), - PRIMARY KEY (`id`), - UNIQUE `ragval_ux_record_layout` (`record_id`, `layout_id`), - CONSTRAINT `ragval_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `ragval_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `record` --- -CREATE TABLE `record` ( - `id` bigint NOT NULL auto_increment, - `created` datetime NOT NULL, - `current_id` bigint NOT NULL DEFAULT 0, - `createdby` bigint NULL, - `approvedby` bigint NULL, - `record_id` bigint NULL, - `approval` smallint NOT NULL DEFAULT 0, - INDEX `record_idx_approvedby` (`approvedby`), - INDEX `record_idx_createdby` (`createdby`), - INDEX `record_idx_current_id` (`current_id`), - INDEX `record_idx_record_id` (`record_id`), - INDEX `record_idx_approval` (`approval`), - PRIMARY KEY (`id`), - CONSTRAINT `record_fk_approvedby` FOREIGN KEY (`approvedby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `record_fk_createdby` FOREIGN KEY (`createdby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `record_fk_current_id` FOREIGN KEY (`current_id`) REFERENCES `current` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `record_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `report` --- -CREATE TABLE `report` ( - `id` bigint NOT NULL auto_increment, - `name` varchar(128) NOT NULL, - `description` varchar(128) NULL, - `user_id` bigint NULL, - `createdby` bigint NULL, - `created` datetime NULL, - `instance_id` bigint NULL, - INDEX `report_idx_createdby` (`createdby`), - INDEX `report_idx_instance_id` (`instance_id`), - INDEX `report_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `report_fk_createdby` FOREIGN KEY (`createdby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `report_instance` --- -CREATE TABLE `report_instance` ( - `id` integer NOT NULL auto_increment, - `report_id` integer NOT NULL, - `layout_id` bigint NOT NULL, - `order` integer NULL, - INDEX `report_instance_idx_layout_id` (`layout_id`), - INDEX `report_instance_idx_report_id` (`report_id`), - PRIMARY KEY (`id`), - CONSTRAINT `report_instance_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_instance_fk_report_id` FOREIGN KEY (`report_id`) REFERENCES `report` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `site` --- -CREATE TABLE `site` ( - `id` integer NOT NULL auto_increment, - `host` varchar(128) NULL, - `name` text NULL, - `created` datetime NULL, - `email_welcome_text` text NULL, - `email_welcome_subject` text NULL, - `email_delete_text` text NULL, - `email_delete_subject` text NULL, - `email_reject_text` text NULL, - `email_reject_subject` text NULL, - `register_text` text NULL, - `homepage_text` text NULL, - `homepage_text2` text NULL, - `register_title_help` text NULL, - `register_freetext1_help` text NULL, - `register_freetext2_help` text NULL, - `register_email_help` text NULL, - `register_organisation_help` text NULL, - `register_organisation_name` text NULL, - `register_organisation_mandatory` smallint NOT NULL DEFAULT 0, - `register_department_help` text NULL, - `register_department_name` text NULL, - `register_department_mandatory` smallint NOT NULL DEFAULT 0, - `register_team_help` text NULL, - `register_team_name` text NULL, - `register_team_mandatory` smallint NOT NULL DEFAULT 0, - `register_notes_help` text NULL, - `register_freetext1_name` text NULL, - `register_freetext2_name` text NULL, - `register_show_organisation` smallint NOT NULL DEFAULT 1, - `register_show_department` smallint NOT NULL DEFAULT 0, - `register_show_team` smallint NOT NULL DEFAULT 0, - `register_show_title` smallint NOT NULL DEFAULT 1, - `hide_account_request` smallint NOT NULL DEFAULT 0, - `remember_user_location` smallint NOT NULL DEFAULT 1, - `user_editable_fields` text NULL, - `register_freetext1_placeholder` text NULL, - `register_freetext2_placeholder` text NULL, - `account_request_notes_name` text NULL, - `account_request_notes_placeholder` text NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB; --- --- Table: `sort` --- -CREATE TABLE `sort` ( - `id` integer NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `layout_id` integer NULL, - `parent_id` integer NULL, - `type` varchar(45) NULL, - `order` integer NULL, - INDEX `sort_idx_layout_id` (`layout_id`), - INDEX `sort_idx_parent_id` (`parent_id`), - INDEX `sort_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `sort_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `sort_fk_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `sort_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `string` --- -CREATE TABLE `string` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `child_unique` smallint NOT NULL DEFAULT 0, - `value` text NULL, - `value_index` varchar(128) NULL, - INDEX `string_idx_layout_id` (`layout_id`), - INDEX `string_idx_record_id` (`record_id`), - INDEX `string_idx_value_index` (`value_index`), - PRIMARY KEY (`id`), - CONSTRAINT `string_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `string_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `submission` --- -CREATE TABLE `submission` ( - `id` integer NOT NULL auto_increment, - `token` varchar(64) NOT NULL, - `created` datetime NULL, - `submitted` smallint NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE `ux_submission_token` (`token`, `submitted`) -) ENGINE=InnoDB; --- --- Table: `team` --- -CREATE TABLE `team` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NULL, - `site_id` integer NULL, - `deleted` smallint NOT NULL DEFAULT 0, - INDEX `team_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `team_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `title` --- -CREATE TABLE `title` ( - `id` integer NOT NULL auto_increment, - `name` varchar(128) NULL, - `site_id` integer NULL, - `deleted` smallint NOT NULL DEFAULT 0, - INDEX `title_idx_site_id` (`site_id`), - PRIMARY KEY (`id`), - CONSTRAINT `title_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `topic` --- -CREATE TABLE `topic` ( - `id` integer NOT NULL auto_increment, - `instance_id` integer NULL, - `name` text NULL, - `description` text NULL, - `initial_state` varchar(32) NULL, - `click_to_edit` smallint NOT NULL DEFAULT 0, - `prevent_edit_topic_id` integer NULL, - INDEX `topic_idx_instance_id` (`instance_id`), - INDEX `topic_idx_prevent_edit_topic_id` (`prevent_edit_topic_id`), - PRIMARY KEY (`id`), - CONSTRAINT `topic_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `topic_fk_prevent_edit_topic_id` FOREIGN KEY (`prevent_edit_topic_id`) REFERENCES `topic` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `user` --- -CREATE TABLE `user` ( - `id` bigint NOT NULL auto_increment, - `site_id` integer NULL, - `firstname` varchar(128) NULL, - `surname` varchar(128) NULL, - `email` text NULL, - `username` text NULL, - `title` integer NULL, - `organisation` integer NULL, - `department_id` integer NULL, - `team_id` integer NULL, - `freetext1` text NULL, - `freetext2` text NULL, - `password` varchar(128) NULL, - `pwchanged` datetime NULL, - `resetpw` varchar(32) NULL, - `deleted` datetime NULL, - `lastlogin` datetime NULL, - `lastfail` datetime NULL, - `failcount` integer NOT NULL DEFAULT 0, - `lastrecord` bigint NULL, - `lastview` bigint NULL, - `session_settings` text NULL, - `value` text NULL, - `account_request` smallint NULL DEFAULT 0, - `account_request_notes` text NULL, - `aup_accepted` datetime NULL, - `limit_to_view` bigint NULL, - `stylesheet` text NULL, - `created` datetime NULL, - `debug_login` smallint NULL DEFAULT 0, - INDEX `user_idx_department_id` (`department_id`), - INDEX `user_idx_lastrecord` (`lastrecord`), - INDEX `user_idx_lastview` (`lastview`), - INDEX `user_idx_limit_to_view` (`limit_to_view`), - INDEX `user_idx_organisation` (`organisation`), - INDEX `user_idx_site_id` (`site_id`), - INDEX `user_idx_team_id` (`team_id`), - INDEX `user_idx_title` (`title`), - INDEX `user_idx_value` (`value`(64)), - INDEX `user_idx_email` (`email`(64)), - INDEX `user_idx_username` (`username`(64)), - PRIMARY KEY (`id`), - CONSTRAINT `user_fk_department_id` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_lastrecord` FOREIGN KEY (`lastrecord`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_lastview` FOREIGN KEY (`lastview`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_limit_to_view` FOREIGN KEY (`limit_to_view`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_organisation` FOREIGN KEY (`organisation`) REFERENCES `organisation` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_site_id` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_team_id` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_fk_title` FOREIGN KEY (`title`) REFERENCES `title` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `user_graph` --- -CREATE TABLE `user_graph` ( - `id` bigint NOT NULL auto_increment, - `user_id` bigint NOT NULL, - `graph_id` integer NOT NULL, - INDEX `user_graph_idx_graph_id` (`graph_id`), - INDEX `user_graph_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `user_graph_fk_graph_id` FOREIGN KEY (`graph_id`) REFERENCES `graph` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_graph_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `user_group` --- -CREATE TABLE `user_group` ( - `id` bigint NOT NULL auto_increment, - `user_id` bigint NOT NULL, - `group_id` integer NOT NULL, - INDEX `user_group_idx_group_id` (`group_id`), - INDEX `user_group_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `user_group_fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_group_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `user_lastrecord` --- -CREATE TABLE `user_lastrecord` ( - `id` bigint NOT NULL auto_increment, - `record_id` bigint NOT NULL, - `instance_id` integer NOT NULL, - `user_id` bigint NOT NULL, - INDEX `user_lastrecord_idx_instance_id` (`instance_id`), - INDEX `user_lastrecord_idx_record_id` (`record_id`), - INDEX `user_lastrecord_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `user_lastrecord_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_lastrecord_fk_record_id` FOREIGN KEY (`record_id`) REFERENCES `record` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_lastrecord_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `user_permission` --- -CREATE TABLE `user_permission` ( - `id` bigint NOT NULL auto_increment, - `user_id` bigint NOT NULL, - `permission_id` integer NOT NULL, - INDEX `user_permission_idx_permission_id` (`permission_id`), - INDEX `user_permission_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `user_permission_fk_permission_id` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `user_permission_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `view` --- -CREATE TABLE `view` ( - `id` bigint NOT NULL auto_increment, - `user_id` bigint NULL, - `group_id` integer NULL, - `name` varchar(128) NULL, - `global` smallint NOT NULL DEFAULT 0, - `is_admin` smallint NOT NULL DEFAULT 0, - `is_limit_extra` smallint NOT NULL DEFAULT 0, - `filter` text NULL, - `instance_id` integer NULL, - `created` datetime NULL, - `createdby` bigint NULL, - INDEX `view_idx_createdby` (`createdby`), - INDEX `view_idx_group_id` (`group_id`), - INDEX `view_idx_instance_id` (`instance_id`), - INDEX `view_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `view_fk_createdby` FOREIGN KEY (`createdby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `view_group` --- -CREATE TABLE `view_group` ( - `id` integer NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `layout_id` integer NULL, - `parent_id` integer NULL, - `order` integer NULL, - INDEX `view_group_idx_layout_id` (`layout_id`), - INDEX `view_group_idx_parent_id` (`parent_id`), - INDEX `view_group_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `view_group_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_group_fk_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_group_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `view_layout` --- -CREATE TABLE `view_layout` ( - `id` integer NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `layout_id` integer NOT NULL, - `order` integer NULL, - INDEX `view_layout_idx_layout_id` (`layout_id`), - INDEX `view_layout_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `view_layout_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_layout_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `view_limit` --- -CREATE TABLE `view_limit` ( - `id` bigint NOT NULL auto_increment, - `view_id` bigint NOT NULL, - `user_id` bigint NOT NULL, - INDEX `view_limit_idx_user_id` (`user_id`), - INDEX `view_limit_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - CONSTRAINT `view_limit_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `view_limit_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; --- --- Table: `widget` --- -CREATE TABLE `widget` ( - `id` integer NOT NULL auto_increment, - `grid_id` varchar(64) NULL, - `dashboard_id` integer NULL, - `type` varchar(16) NULL, - `title` text NULL, - `static` smallint NOT NULL DEFAULT 0, - `h` smallint NULL DEFAULT 0, - `w` smallint NULL DEFAULT 0, - `x` smallint NULL DEFAULT 0, - `y` smallint NULL DEFAULT 0, - `content` text NULL, - `view_id` integer NULL, - `graph_id` integer NULL, - `rows` integer NULL, - `tl_options` text NULL, - `globe_options` text NULL, - INDEX `widget_idx_dashboard_id` (`dashboard_id`), - INDEX `widget_idx_graph_id` (`graph_id`), - INDEX `widget_idx_view_id` (`view_id`), - PRIMARY KEY (`id`), - UNIQUE `widget_ux_dashboard_grid` (`dashboard_id`, `grid_id`), - CONSTRAINT `widget_fk_dashboard_id` FOREIGN KEY (`dashboard_id`) REFERENCES `dashboard` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `widget_fk_graph_id` FOREIGN KEY (`graph_id`) REFERENCES `graph` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `widget_fk_view_id` FOREIGN KEY (`view_id`) REFERENCES `view` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; -SET foreign_key_checks=1; diff --git a/share/migrations/MySQL/downgrade/101-100/001-auto.sql b/share/migrations/MySQL/downgrade/101-100/001-auto.sql deleted file mode 100644 index fd8c1e975..000000000 --- a/share/migrations/MySQL/downgrade/101-100/001-auto.sql +++ /dev/null @@ -1,24 +0,0 @@ --- Convert schema '/home/droberts/source/gads/share/migrations/_source/deploy/101/001-auto.yml' to '/home/droberts/source/gads/share/migrations/_source/deploy/100/001-auto.yml':; - -; -BEGIN; - -; -ALTER TABLE report DROP FOREIGN KEY report_fk_createdby, - DROP FOREIGN KEY report_fk_instance_id, - DROP FOREIGN KEY report_fk_user_id; - -; -DROP TABLE report; - -; -ALTER TABLE report_instance DROP FOREIGN KEY report_instance_fk_layout_id, - DROP FOREIGN KEY report_instance_fk_report_id; - -; -DROP TABLE report_instance; - -; - -COMMIT; - diff --git a/share/migrations/MySQL/upgrade/100-101/001-auto.sql b/share/migrations/MySQL/upgrade/100-101/001-auto.sql deleted file mode 100644 index a6119aee5..000000000 --- a/share/migrations/MySQL/upgrade/100-101/001-auto.sql +++ /dev/null @@ -1,46 +0,0 @@ --- Convert schema '/home/droberts/source/gads/share/migrations/_source/deploy/100/001-auto.yml' to '/home/droberts/source/gads/share/migrations/_source/deploy/101/001-auto.yml':; - -; -BEGIN; - -; -SET foreign_key_checks=0; - -; -CREATE TABLE `report` ( - `id` bigint NOT NULL auto_increment, - `name` varchar(128) NOT NULL, - `description` varchar(128) NULL, - `user_id` bigint NULL, - `createdby` bigint NULL, - `created` datetime NULL, - `instance_id` bigint NULL, - INDEX `report_idx_createdby` (`createdby`), - INDEX `report_idx_instance_id` (`instance_id`), - INDEX `report_idx_user_id` (`user_id`), - PRIMARY KEY (`id`), - CONSTRAINT `report_fk_createdby` FOREIGN KEY (`createdby`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_fk_instance_id` FOREIGN KEY (`instance_id`) REFERENCES `instance` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; - -; -CREATE TABLE `report_instance` ( - `id` integer NOT NULL auto_increment, - `report_id` integer NOT NULL, - `layout_id` bigint NOT NULL, - `order` integer NULL, - INDEX `report_instance_idx_layout_id` (`layout_id`), - INDEX `report_instance_idx_report_id` (`report_id`), - PRIMARY KEY (`id`), - CONSTRAINT `report_instance_fk_layout_id` FOREIGN KEY (`layout_id`) REFERENCES `layout` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `report_instance_fk_report_id` FOREIGN KEY (`report_id`) REFERENCES `report` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; - -; -SET foreign_key_checks=1; - -; - -COMMIT; - diff --git a/share/migrations/PostgreSQL/deploy/101/001-auto-__VERSION.sql b/share/migrations/PostgreSQL/deploy/101/001-auto-__VERSION.sql deleted file mode 100644 index 059e9ae4b..000000000 --- a/share/migrations/PostgreSQL/deploy/101/001-auto-__VERSION.sql +++ /dev/null @@ -1,18 +0,0 @@ --- --- Created by SQL::Translator::Producer::PostgreSQL --- Created on Tue Oct 24 10:06:40 2023 --- -; --- --- Table: dbix_class_deploymenthandler_versions --- -CREATE TABLE "dbix_class_deploymenthandler_versions" ( - "id" serial NOT NULL, - "version" character varying(50) NOT NULL, - "ddl" text, - "upgrade_sql" text, - PRIMARY KEY ("id"), - CONSTRAINT "dbix_class_deploymenthandler_versions_version" UNIQUE ("version") -); - -; diff --git a/share/migrations/PostgreSQL/deploy/101/001-auto.sql b/share/migrations/PostgreSQL/deploy/101/001-auto.sql deleted file mode 100644 index 66536ad1a..000000000 --- a/share/migrations/PostgreSQL/deploy/101/001-auto.sql +++ /dev/null @@ -1,1766 +0,0 @@ --- --- Created by SQL::Translator::Producer::PostgreSQL --- Created on Tue Oct 24 10:06:40 2023 --- -; --- --- Table: alert --- -CREATE TABLE "alert" ( - "id" serial NOT NULL, - "view_id" bigint NOT NULL, - "user_id" bigint NOT NULL, - "frequency" integer DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "alert_idx_user_id" on "alert" ("user_id"); -CREATE INDEX "alert_idx_view_id" on "alert" ("view_id"); - -; --- --- Table: alert_cache --- -CREATE TABLE "alert_cache" ( - "id" bigserial NOT NULL, - "layout_id" integer NOT NULL, - "view_id" bigint NOT NULL, - "current_id" bigint NOT NULL, - "user_id" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "alert_cache_idx_current_id" on "alert_cache" ("current_id"); -CREATE INDEX "alert_cache_idx_layout_id" on "alert_cache" ("layout_id"); -CREATE INDEX "alert_cache_idx_user_id" on "alert_cache" ("user_id"); -CREATE INDEX "alert_cache_idx_view_id" on "alert_cache" ("view_id"); - -; --- --- Table: alert_column --- -CREATE TABLE "alert_column" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "instance_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "alert_column_idx_instance_id" on "alert_column" ("instance_id"); -CREATE INDEX "alert_column_idx_layout_id" on "alert_column" ("layout_id"); - -; --- --- Table: alert_send --- -CREATE TABLE "alert_send" ( - "id" bigserial NOT NULL, - "layout_id" integer, - "alert_id" integer NOT NULL, - "current_id" bigint NOT NULL, - "status" character(7), - PRIMARY KEY ("id"), - CONSTRAINT "alert_send_all" UNIQUE ("layout_id", "alert_id", "current_id", "status") -); -CREATE INDEX "alert_send_idx_alert_id" on "alert_send" ("alert_id"); -CREATE INDEX "alert_send_idx_current_id" on "alert_send" ("current_id"); -CREATE INDEX "alert_send_idx_layout_id" on "alert_send" ("layout_id"); - -; --- --- Table: audit --- -CREATE TABLE "audit" ( - "id" bigserial NOT NULL, - "site_id" integer, - "user_id" bigint, - "type" character varying(45), - "datetime" timestamp, - "method" character varying(45), - "url" text, - "description" text, - "instance_id" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "audit_idx_instance_id" on "audit" ("instance_id"); -CREATE INDEX "audit_idx_site_id" on "audit" ("site_id"); -CREATE INDEX "audit_idx_user_id" on "audit" ("user_id"); -CREATE INDEX "audit_idx_datetime" on "audit" ("datetime"); - -; --- --- Table: authentication --- -CREATE TABLE "authentication" ( - "id" bigserial NOT NULL, - "site_id" integer, - "type" character varying(32), - "name" text, - "xml" text, - "saml2_firstname" text, - "saml2_surname" text, - "enabled" smallint DEFAULT 0 NOT NULL, - "error_messages" text, - PRIMARY KEY ("id") -); -CREATE INDEX "authentication_idx_site_id" on "authentication" ("site_id"); - -; --- --- Table: calc --- -CREATE TABLE "calc" ( - "id" serial NOT NULL, - "layout_id" integer, - "calc" text, - "code" text, - "return_format" character varying(45), - "decimal_places" smallint, - PRIMARY KEY ("id") -); -CREATE INDEX "calc_idx_layout_id" on "calc" ("layout_id"); - -; --- --- Table: calcval --- -CREATE TABLE "calcval" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "value_text" text, - "value_int" bigint, - "value_date" date, - "value_numeric" numeric(20,5), - "value_date_from" timestamp, - "value_date_to" timestamp, - PRIMARY KEY ("id") -); -CREATE INDEX "calcval_idx_layout_id" on "calcval" ("layout_id"); -CREATE INDEX "calcval_idx_record_id" on "calcval" ("record_id"); -CREATE INDEX "calcval_idx_value_text" on "calcval" ("value_text"); -CREATE INDEX "calcval_idx_value_numeric" on "calcval" ("value_numeric"); -CREATE INDEX "calcval_idx_value_int" on "calcval" ("value_int"); -CREATE INDEX "calcval_idx_value_date" on "calcval" ("value_date"); - -; --- --- Table: current --- -CREATE TABLE "current" ( - "id" bigserial NOT NULL, - "serial" bigint, - "parent_id" bigint, - "instance_id" integer, - "linked_id" bigint, - "deleted" timestamp, - "deletedby" bigint, - "draftuser_id" bigint, - PRIMARY KEY ("id"), - CONSTRAINT "current_ux_instance_serial" UNIQUE ("instance_id", "serial") -); -CREATE INDEX "current_idx_deletedby" on "current" ("deletedby"); -CREATE INDEX "current_idx_draftuser_id" on "current" ("draftuser_id"); -CREATE INDEX "current_idx_instance_id" on "current" ("instance_id"); -CREATE INDEX "current_idx_linked_id" on "current" ("linked_id"); -CREATE INDEX "current_idx_parent_id" on "current" ("parent_id"); - -; --- --- Table: curval --- -CREATE TABLE "curval" ( - "id" bigserial NOT NULL, - "record_id" bigint, - "layout_id" integer, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "curval_idx_layout_id" on "curval" ("layout_id"); -CREATE INDEX "curval_idx_record_id" on "curval" ("record_id"); -CREATE INDEX "curval_idx_value" on "curval" ("value"); - -; --- --- Table: curval_fields --- -CREATE TABLE "curval_fields" ( - "id" serial NOT NULL, - "parent_id" integer NOT NULL, - "child_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "curval_fields_idx_child_id" on "curval_fields" ("child_id"); -CREATE INDEX "curval_fields_idx_parent_id" on "curval_fields" ("parent_id"); - -; --- --- Table: dashboard --- -CREATE TABLE "dashboard" ( - "id" serial NOT NULL, - "site_id" integer, - "instance_id" integer, - "user_id" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "dashboard_idx_instance_id" on "dashboard" ("instance_id"); -CREATE INDEX "dashboard_idx_site_id" on "dashboard" ("site_id"); -CREATE INDEX "dashboard_idx_user_id" on "dashboard" ("user_id"); - -; --- --- Table: date --- -CREATE TABLE "date" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" date, - PRIMARY KEY ("id") -); -CREATE INDEX "date_idx_layout_id" on "date" ("layout_id"); -CREATE INDEX "date_idx_record_id" on "date" ("record_id"); -CREATE INDEX "date_idx_value" on "date" ("value"); - -; --- --- Table: daterange --- -CREATE TABLE "daterange" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "from" date, - "to" date, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" character varying(45), - PRIMARY KEY ("id") -); -CREATE INDEX "daterange_idx_layout_id" on "daterange" ("layout_id"); -CREATE INDEX "daterange_idx_record_id" on "daterange" ("record_id"); -CREATE INDEX "daterange_idx_from" on "daterange" ("from"); -CREATE INDEX "daterange_idx_to" on "daterange" ("to"); -CREATE INDEX "daterange_idx_value" on "daterange" ("value"); - -; --- --- Table: department --- -CREATE TABLE "department" ( - "id" serial NOT NULL, - "name" character varying(128), - "site_id" integer, - "deleted" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "department_idx_site_id" on "department" ("site_id"); - -; --- --- Table: display_field --- -CREATE TABLE "display_field" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "display_field_id" integer NOT NULL, - "regex" text, - "operator" character varying(16), - PRIMARY KEY ("id") -); -CREATE INDEX "display_field_idx_display_field_id" on "display_field" ("display_field_id"); -CREATE INDEX "display_field_idx_layout_id" on "display_field" ("layout_id"); - -; --- --- Table: enum --- -CREATE TABLE "enum" ( - "id" bigserial NOT NULL, - "record_id" bigint, - "layout_id" integer, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "enum_idx_layout_id" on "enum" ("layout_id"); -CREATE INDEX "enum_idx_record_id" on "enum" ("record_id"); -CREATE INDEX "enum_idx_value" on "enum" ("value"); - -; --- --- Table: enumval --- -CREATE TABLE "enumval" ( - "id" serial NOT NULL, - "value" text, - "layout_id" integer, - "deleted" smallint DEFAULT 0 NOT NULL, - "parent" integer, - "position" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "enumval_idx_layout_id" on "enumval" ("layout_id"); -CREATE INDEX "enumval_idx_parent" on "enumval" ("parent"); -CREATE INDEX "enumval_idx_value" on "enumval" ("value"); - -; --- --- Table: export --- -CREATE TABLE "export" ( - "id" serial NOT NULL, - "site_id" integer, - "user_id" bigint NOT NULL, - "type" character varying(45), - "started" timestamp, - "completed" timestamp, - "result" text, - "result_internal" text, - "mimetype" text, - "content" bytea, - PRIMARY KEY ("id") -); -CREATE INDEX "export_idx_site_id" on "export" ("site_id"); -CREATE INDEX "export_idx_user_id" on "export" ("user_id"); - -; --- --- Table: file --- -CREATE TABLE "file" ( - "id" bigserial NOT NULL, - "record_id" bigint, - "layout_id" integer, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "file_idx_layout_id" on "file" ("layout_id"); -CREATE INDEX "file_idx_record_id" on "file" ("record_id"); -CREATE INDEX "file_idx_value" on "file" ("value"); - -; --- --- Table: file_option --- -CREATE TABLE "file_option" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "filesize" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "file_option_idx_layout_id" on "file_option" ("layout_id"); - -; --- --- Table: fileval --- -CREATE TABLE "fileval" ( - "id" bigserial NOT NULL, - "name" text, - "mimetype" text, - "content" bytea, - "is_independent" smallint DEFAULT 0 NOT NULL, - "edit_user_id" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "fileval_idx_edit_user_id" on "fileval" ("edit_user_id"); -CREATE INDEX "fileval_idx_name" on "fileval" ("name"); - -; --- --- Table: filter --- -CREATE TABLE "filter" ( - "id" bigserial NOT NULL, - "view_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "filter_idx_layout_id" on "filter" ("layout_id"); -CREATE INDEX "filter_idx_view_id" on "filter" ("view_id"); - -; --- --- Table: filtered_value --- -CREATE TABLE "filtered_value" ( - "id" serial NOT NULL, - "submission_id" integer, - "layout_id" integer, - "current_id" integer, - PRIMARY KEY ("id"), - CONSTRAINT "ux_submission_layout_current" UNIQUE ("submission_id", "layout_id", "current_id") -); -CREATE INDEX "filtered_value_idx_current_id" on "filtered_value" ("current_id"); -CREATE INDEX "filtered_value_idx_layout_id" on "filtered_value" ("layout_id"); -CREATE INDEX "filtered_value_idx_submission_id" on "filtered_value" ("submission_id"); - -; --- --- Table: graph --- -CREATE TABLE "graph" ( - "id" serial NOT NULL, - "title" text, - "description" text, - "y_axis" integer, - "y_axis_stack" character varying(45), - "y_axis_label" text, - "x_axis" integer, - "x_axis_link" integer, - "x_axis_grouping" character varying(45), - "group_by" integer, - "stackseries" smallint DEFAULT 0 NOT NULL, - "as_percent" smallint DEFAULT 0 NOT NULL, - "type" character varying(45), - "metric_group" integer, - "instance_id" integer, - "is_shared" smallint DEFAULT 0 NOT NULL, - "user_id" bigint, - "group_id" integer, - "trend" character varying(45), - "from" date, - "to" date, - "x_axis_range" character varying(45), - PRIMARY KEY ("id") -); -CREATE INDEX "graph_idx_group_id" on "graph" ("group_id"); -CREATE INDEX "graph_idx_group_by" on "graph" ("group_by"); -CREATE INDEX "graph_idx_instance_id" on "graph" ("instance_id"); -CREATE INDEX "graph_idx_metric_group" on "graph" ("metric_group"); -CREATE INDEX "graph_idx_user_id" on "graph" ("user_id"); -CREATE INDEX "graph_idx_x_axis" on "graph" ("x_axis"); -CREATE INDEX "graph_idx_x_axis_link" on "graph" ("x_axis_link"); -CREATE INDEX "graph_idx_y_axis" on "graph" ("y_axis"); - -; --- --- Table: graph_color --- -CREATE TABLE "graph_color" ( - "id" bigserial NOT NULL, - "name" character varying(128), - "color" character(6), - PRIMARY KEY ("id"), - CONSTRAINT "ux_graph_color_name" UNIQUE ("name") -); - -; --- --- Table: group --- -CREATE TABLE "group" ( - "id" serial NOT NULL, - "name" character varying(128), - "default_read" smallint DEFAULT 0 NOT NULL, - "default_write_new" smallint DEFAULT 0 NOT NULL, - "default_write_existing" smallint DEFAULT 0 NOT NULL, - "default_approve_new" smallint DEFAULT 0 NOT NULL, - "default_approve_existing" smallint DEFAULT 0 NOT NULL, - "default_write_new_no_approval" smallint DEFAULT 0 NOT NULL, - "default_write_existing_no_approval" smallint DEFAULT 0 NOT NULL, - "site_id" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "group_idx_site_id" on "group" ("site_id"); - -; --- --- Table: import --- -CREATE TABLE "import" ( - "id" serial NOT NULL, - "site_id" integer, - "instance_id" integer, - "user_id" bigint NOT NULL, - "type" character varying(45), - "row_count" integer DEFAULT 0 NOT NULL, - "started" timestamp, - "completed" timestamp, - "written_count" integer DEFAULT 0 NOT NULL, - "error_count" integer DEFAULT 0 NOT NULL, - "skipped_count" integer DEFAULT 0 NOT NULL, - "result" text, - PRIMARY KEY ("id") -); -CREATE INDEX "import_idx_instance_id" on "import" ("instance_id"); -CREATE INDEX "import_idx_site_id" on "import" ("site_id"); -CREATE INDEX "import_idx_user_id" on "import" ("user_id"); - -; --- --- Table: import_row --- -CREATE TABLE "import_row" ( - "id" bigserial NOT NULL, - "import_id" integer NOT NULL, - "status" character varying(45), - "content" text, - "errors" text, - "changes" text, - PRIMARY KEY ("id") -); -CREATE INDEX "import_row_idx_import_id" on "import_row" ("import_id"); - -; --- --- Table: instance --- -CREATE TABLE "instance" ( - "id" serial NOT NULL, - "name" text, - "name_short" character varying(64), - "site_id" integer, - "sort_layout_id" integer, - "sort_type" character varying(45), - "view_limit_id" integer, - "default_view_limit_extra_id" integer, - "homepage_text" text, - "homepage_text2" text, - "record_name" text, - "forget_history" smallint DEFAULT 0, - "no_overnight_update" smallint DEFAULT 0, - "api_index_layout_id" integer, - "forward_record_after_create" smallint DEFAULT 0, - "no_hide_blank" smallint DEFAULT 0 NOT NULL, - "no_download_pdf" smallint DEFAULT 0 NOT NULL, - "no_copy_record" smallint DEFAULT 0 NOT NULL, - "hide_in_selector" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "instance_idx_api_index_layout_id" on "instance" ("api_index_layout_id"); -CREATE INDEX "instance_idx_default_view_limit_extra_id" on "instance" ("default_view_limit_extra_id"); -CREATE INDEX "instance_idx_site_id" on "instance" ("site_id"); -CREATE INDEX "instance_idx_sort_layout_id" on "instance" ("sort_layout_id"); -CREATE INDEX "instance_idx_view_limit_id" on "instance" ("view_limit_id"); - -; --- --- Table: instance_group --- -CREATE TABLE "instance_group" ( - "id" serial NOT NULL, - "instance_id" integer NOT NULL, - "group_id" integer NOT NULL, - "permission" character varying(45) NOT NULL, - PRIMARY KEY ("id"), - CONSTRAINT "instance_group_ux_instance_group_permission" UNIQUE ("instance_id", "group_id", "permission") -); -CREATE INDEX "instance_group_idx_group_id" on "instance_group" ("group_id"); -CREATE INDEX "instance_group_idx_instance_id" on "instance_group" ("instance_id"); - -; --- --- Table: instance_rag --- -CREATE TABLE "instance_rag" ( - "id" serial NOT NULL, - "instance_id" integer NOT NULL, - "rag" character varying(16) NOT NULL, - "enabled" smallint DEFAULT 0 NOT NULL, - "description" text, - PRIMARY KEY ("id"), - CONSTRAINT "instance_rag_ux_instance_rag" UNIQUE ("instance_id", "rag") -); -CREATE INDEX "instance_rag_idx_instance_id" on "instance_rag" ("instance_id"); - -; --- --- Table: intgr --- -CREATE TABLE "intgr" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "intgr_idx_layout_id" on "intgr" ("layout_id"); -CREATE INDEX "intgr_idx_record_id" on "intgr" ("record_id"); -CREATE INDEX "intgr_idx_value" on "intgr" ("value"); - -; --- --- Table: layout --- -CREATE TABLE "layout" ( - "id" serial NOT NULL, - "name" text, - "name_short" character varying(64), - "type" character varying(45), - "permission" integer DEFAULT 0 NOT NULL, - "optional" smallint DEFAULT 0 NOT NULL, - "remember" smallint DEFAULT 0 NOT NULL, - "isunique" smallint DEFAULT 0 NOT NULL, - "textbox" smallint DEFAULT 0 NOT NULL, - "typeahead" smallint DEFAULT 0 NOT NULL, - "force_regex" text, - "position" integer, - "ordering" character varying(45), - "end_node_only" smallint DEFAULT 0 NOT NULL, - "multivalue" smallint DEFAULT 0 NOT NULL, - "can_child" smallint DEFAULT 0 NOT NULL, - "internal" smallint DEFAULT 0 NOT NULL, - "description" text, - "helptext" text, - "options" text, - "display_field" integer, - "display_regex" text, - "display_condition" character(3), - "display_matchtype" text, - "instance_id" integer, - "link_parent" integer, - "related_field" integer, - "width" integer DEFAULT 50 NOT NULL, - "filter" text, - "topic_id" integer, - "aggregate" character varying(45), - "group_display" character varying(45), - "lookup_endpoint" text, - "lookup_group" smallint, - PRIMARY KEY ("id"), - CONSTRAINT "layout_ux_instance_name_short" UNIQUE ("instance_id", "name_short") -); -CREATE INDEX "layout_idx_display_field" on "layout" ("display_field"); -CREATE INDEX "layout_idx_instance_id" on "layout" ("instance_id"); -CREATE INDEX "layout_idx_link_parent" on "layout" ("link_parent"); -CREATE INDEX "layout_idx_related_field" on "layout" ("related_field"); -CREATE INDEX "layout_idx_topic_id" on "layout" ("topic_id"); - -; --- --- Table: layout_depend --- -CREATE TABLE "layout_depend" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "depends_on" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "layout_depend_idx_depends_on" on "layout_depend" ("depends_on"); -CREATE INDEX "layout_depend_idx_layout_id" on "layout_depend" ("layout_id"); - -; --- --- Table: layout_group --- -CREATE TABLE "layout_group" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "group_id" integer NOT NULL, - "permission" character varying(45) NOT NULL, - PRIMARY KEY ("id"), - CONSTRAINT "layout_group_ux_layout_group_permission" UNIQUE ("layout_id", "group_id", "permission") -); -CREATE INDEX "layout_group_idx_group_id" on "layout_group" ("group_id"); -CREATE INDEX "layout_group_idx_layout_id" on "layout_group" ("layout_id"); -CREATE INDEX "layout_group_idx_permission" on "layout_group" ("permission"); - -; --- --- Table: metric --- -CREATE TABLE "metric" ( - "id" serial NOT NULL, - "metric_group" integer NOT NULL, - "x_axis_value" text, - "target" bigint, - "y_axis_grouping_value" text, - PRIMARY KEY ("id") -); -CREATE INDEX "metric_idx_metric_group" on "metric" ("metric_group"); - -; --- --- Table: metric_group --- -CREATE TABLE "metric_group" ( - "id" serial NOT NULL, - "name" text, - "instance_id" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "metric_group_idx_instance_id" on "metric_group" ("instance_id"); - -; --- --- Table: oauthclient --- -CREATE TABLE "oauthclient" ( - "id" bigserial NOT NULL, - "client_id" character varying(64) NOT NULL, - "client_secret" character varying(64) NOT NULL, - PRIMARY KEY ("id") -); - -; --- --- Table: oauthtoken --- -CREATE TABLE "oauthtoken" ( - "token" character varying(128) NOT NULL, - "related_token" character varying(128) NOT NULL, - "oauthclient_id" integer NOT NULL, - "user_id" bigint NOT NULL, - "type" character varying(12) NOT NULL, - "expires" integer, - PRIMARY KEY ("token") -); -CREATE INDEX "oauthtoken_idx_oauthclient_id" on "oauthtoken" ("oauthclient_id"); -CREATE INDEX "oauthtoken_idx_user_id" on "oauthtoken" ("user_id"); - -; --- --- Table: organisation --- -CREATE TABLE "organisation" ( - "id" serial NOT NULL, - "name" character varying(128), - "site_id" integer, - "deleted" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "organisation_idx_site_id" on "organisation" ("site_id"); - -; --- --- Table: permission --- -CREATE TABLE "permission" ( - "id" serial NOT NULL, - "name" character varying(128) NOT NULL, - "description" text, - "order" integer, - PRIMARY KEY ("id") -); - -; --- --- Table: person --- -CREATE TABLE "person" ( - "id" bigserial NOT NULL, - "record_id" bigint, - "layout_id" integer, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "person_idx_layout_id" on "person" ("layout_id"); -CREATE INDEX "person_idx_record_id" on "person" ("record_id"); -CREATE INDEX "person_idx_value" on "person" ("value"); - -; --- --- Table: rag --- -CREATE TABLE "rag" ( - "id" serial NOT NULL, - "layout_id" integer NOT NULL, - "red" text, - "amber" text, - "green" text, - "code" text, - PRIMARY KEY ("id") -); -CREATE INDEX "rag_idx_layout_id" on "rag" ("layout_id"); - -; --- --- Table: ragval --- -CREATE TABLE "ragval" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "value" character varying(16), - PRIMARY KEY ("id"), - CONSTRAINT "ragval_ux_record_layout" UNIQUE ("record_id", "layout_id") -); -CREATE INDEX "ragval_idx_layout_id" on "ragval" ("layout_id"); -CREATE INDEX "ragval_idx_record_id" on "ragval" ("record_id"); -CREATE INDEX "ragval_idx_value" on "ragval" ("value"); - -; --- --- Table: record --- -CREATE TABLE "record" ( - "id" bigserial NOT NULL, - "created" timestamp NOT NULL, - "current_id" bigint DEFAULT 0 NOT NULL, - "createdby" bigint, - "approvedby" bigint, - "record_id" bigint, - "approval" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "record_idx_approvedby" on "record" ("approvedby"); -CREATE INDEX "record_idx_createdby" on "record" ("createdby"); -CREATE INDEX "record_idx_current_id" on "record" ("current_id"); -CREATE INDEX "record_idx_record_id" on "record" ("record_id"); -CREATE INDEX "record_idx_approval" on "record" ("approval"); - -; --- --- Table: report --- -CREATE TABLE "report" ( - "id" bigserial NOT NULL, - "name" character varying(128) NOT NULL, - "description" character varying(128), - "user_id" bigint, - "createdby" bigint, - "created" timestamp, - "instance_id" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "report_idx_createdby" on "report" ("createdby"); -CREATE INDEX "report_idx_instance_id" on "report" ("instance_id"); -CREATE INDEX "report_idx_user_id" on "report" ("user_id"); - -; --- --- Table: report_instance --- -CREATE TABLE "report_instance" ( - "id" serial NOT NULL, - "report_id" integer NOT NULL, - "layout_id" bigint NOT NULL, - "order" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "report_instance_idx_layout_id" on "report_instance" ("layout_id"); -CREATE INDEX "report_instance_idx_report_id" on "report_instance" ("report_id"); - -; --- --- Table: site --- -CREATE TABLE "site" ( - "id" serial NOT NULL, - "host" character varying(128), - "name" text, - "created" timestamp, - "email_welcome_text" text, - "email_welcome_subject" text, - "email_delete_text" text, - "email_delete_subject" text, - "email_reject_text" text, - "email_reject_subject" text, - "register_text" text, - "homepage_text" text, - "homepage_text2" text, - "register_title_help" text, - "register_freetext1_help" text, - "register_freetext2_help" text, - "register_email_help" text, - "register_organisation_help" text, - "register_organisation_name" text, - "register_organisation_mandatory" smallint DEFAULT 0 NOT NULL, - "register_department_help" text, - "register_department_name" text, - "register_department_mandatory" smallint DEFAULT 0 NOT NULL, - "register_team_help" text, - "register_team_name" text, - "register_team_mandatory" smallint DEFAULT 0 NOT NULL, - "register_notes_help" text, - "register_freetext1_name" text, - "register_freetext2_name" text, - "register_show_organisation" smallint DEFAULT 1 NOT NULL, - "register_show_department" smallint DEFAULT 0 NOT NULL, - "register_show_team" smallint DEFAULT 0 NOT NULL, - "register_show_title" smallint DEFAULT 1 NOT NULL, - "hide_account_request" smallint DEFAULT 0 NOT NULL, - "remember_user_location" smallint DEFAULT 1 NOT NULL, - "user_editable_fields" text, - "register_freetext1_placeholder" text, - "register_freetext2_placeholder" text, - "account_request_notes_name" text, - "account_request_notes_placeholder" text, - PRIMARY KEY ("id") -); - -; --- --- Table: sort --- -CREATE TABLE "sort" ( - "id" serial NOT NULL, - "view_id" bigint NOT NULL, - "layout_id" integer, - "parent_id" integer, - "type" character varying(45), - "order" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "sort_idx_layout_id" on "sort" ("layout_id"); -CREATE INDEX "sort_idx_parent_id" on "sort" ("parent_id"); -CREATE INDEX "sort_idx_view_id" on "sort" ("view_id"); - -; --- --- Table: string --- -CREATE TABLE "string" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "child_unique" smallint DEFAULT 0 NOT NULL, - "value" text, - "value_index" character varying(128), - PRIMARY KEY ("id") -); -CREATE INDEX "string_idx_layout_id" on "string" ("layout_id"); -CREATE INDEX "string_idx_record_id" on "string" ("record_id"); -CREATE INDEX "string_idx_value_index" on "string" ("value_index"); - -; --- --- Table: submission --- -CREATE TABLE "submission" ( - "id" serial NOT NULL, - "token" character varying(64) NOT NULL, - "created" timestamp, - "submitted" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id"), - CONSTRAINT "ux_submission_token" UNIQUE ("token", "submitted") -); - -; --- --- Table: team --- -CREATE TABLE "team" ( - "id" serial NOT NULL, - "name" character varying(128), - "site_id" integer, - "deleted" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "team_idx_site_id" on "team" ("site_id"); - -; --- --- Table: title --- -CREATE TABLE "title" ( - "id" serial NOT NULL, - "name" character varying(128), - "site_id" integer, - "deleted" smallint DEFAULT 0 NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "title_idx_site_id" on "title" ("site_id"); - -; --- --- Table: topic --- -CREATE TABLE "topic" ( - "id" serial NOT NULL, - "instance_id" integer, - "name" text, - "description" text, - "initial_state" character varying(32), - "click_to_edit" smallint DEFAULT 0 NOT NULL, - "prevent_edit_topic_id" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "topic_idx_instance_id" on "topic" ("instance_id"); -CREATE INDEX "topic_idx_prevent_edit_topic_id" on "topic" ("prevent_edit_topic_id"); - -; --- --- Table: user --- -CREATE TABLE "user" ( - "id" bigserial NOT NULL, - "site_id" integer, - "firstname" character varying(128), - "surname" character varying(128), - "email" text, - "username" text, - "title" integer, - "organisation" integer, - "department_id" integer, - "team_id" integer, - "freetext1" text, - "freetext2" text, - "password" character varying(128), - "pwchanged" timestamp, - "resetpw" character varying(32), - "deleted" timestamp, - "lastlogin" timestamp, - "lastfail" timestamp, - "failcount" integer DEFAULT 0 NOT NULL, - "lastrecord" bigint, - "lastview" bigint, - "session_settings" text, - "value" text, - "account_request" smallint DEFAULT 0, - "account_request_notes" text, - "aup_accepted" timestamp, - "limit_to_view" bigint, - "stylesheet" text, - "created" timestamp, - "debug_login" smallint DEFAULT 0, - PRIMARY KEY ("id") -); -CREATE INDEX "user_idx_department_id" on "user" ("department_id"); -CREATE INDEX "user_idx_lastrecord" on "user" ("lastrecord"); -CREATE INDEX "user_idx_lastview" on "user" ("lastview"); -CREATE INDEX "user_idx_limit_to_view" on "user" ("limit_to_view"); -CREATE INDEX "user_idx_organisation" on "user" ("organisation"); -CREATE INDEX "user_idx_site_id" on "user" ("site_id"); -CREATE INDEX "user_idx_team_id" on "user" ("team_id"); -CREATE INDEX "user_idx_title" on "user" ("title"); -CREATE INDEX "user_idx_value" on "user" ("value"); -CREATE INDEX "user_idx_email" on "user" ("email"); -CREATE INDEX "user_idx_username" on "user" ("username"); - -; --- --- Table: user_graph --- -CREATE TABLE "user_graph" ( - "id" bigserial NOT NULL, - "user_id" bigint NOT NULL, - "graph_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "user_graph_idx_graph_id" on "user_graph" ("graph_id"); -CREATE INDEX "user_graph_idx_user_id" on "user_graph" ("user_id"); - -; --- --- Table: user_group --- -CREATE TABLE "user_group" ( - "id" bigserial NOT NULL, - "user_id" bigint NOT NULL, - "group_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "user_group_idx_group_id" on "user_group" ("group_id"); -CREATE INDEX "user_group_idx_user_id" on "user_group" ("user_id"); - -; --- --- Table: user_lastrecord --- -CREATE TABLE "user_lastrecord" ( - "id" bigserial NOT NULL, - "record_id" bigint NOT NULL, - "instance_id" integer NOT NULL, - "user_id" bigint NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "user_lastrecord_idx_instance_id" on "user_lastrecord" ("instance_id"); -CREATE INDEX "user_lastrecord_idx_record_id" on "user_lastrecord" ("record_id"); -CREATE INDEX "user_lastrecord_idx_user_id" on "user_lastrecord" ("user_id"); - -; --- --- Table: user_permission --- -CREATE TABLE "user_permission" ( - "id" bigserial NOT NULL, - "user_id" bigint NOT NULL, - "permission_id" integer NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "user_permission_idx_permission_id" on "user_permission" ("permission_id"); -CREATE INDEX "user_permission_idx_user_id" on "user_permission" ("user_id"); - -; --- --- Table: view --- -CREATE TABLE "view" ( - "id" bigserial NOT NULL, - "user_id" bigint, - "group_id" integer, - "name" character varying(128), - "global" smallint DEFAULT 0 NOT NULL, - "is_admin" smallint DEFAULT 0 NOT NULL, - "is_limit_extra" smallint DEFAULT 0 NOT NULL, - "filter" text, - "instance_id" integer, - "created" timestamp, - "createdby" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "view_idx_createdby" on "view" ("createdby"); -CREATE INDEX "view_idx_group_id" on "view" ("group_id"); -CREATE INDEX "view_idx_instance_id" on "view" ("instance_id"); -CREATE INDEX "view_idx_user_id" on "view" ("user_id"); - -; --- --- Table: view_group --- -CREATE TABLE "view_group" ( - "id" serial NOT NULL, - "view_id" bigint NOT NULL, - "layout_id" integer, - "parent_id" integer, - "order" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "view_group_idx_layout_id" on "view_group" ("layout_id"); -CREATE INDEX "view_group_idx_parent_id" on "view_group" ("parent_id"); -CREATE INDEX "view_group_idx_view_id" on "view_group" ("view_id"); - -; --- --- Table: view_layout --- -CREATE TABLE "view_layout" ( - "id" serial NOT NULL, - "view_id" bigint NOT NULL, - "layout_id" integer NOT NULL, - "order" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "view_layout_idx_layout_id" on "view_layout" ("layout_id"); -CREATE INDEX "view_layout_idx_view_id" on "view_layout" ("view_id"); - -; --- --- Table: view_limit --- -CREATE TABLE "view_limit" ( - "id" bigserial NOT NULL, - "view_id" bigint NOT NULL, - "user_id" bigint NOT NULL, - PRIMARY KEY ("id") -); -CREATE INDEX "view_limit_idx_user_id" on "view_limit" ("user_id"); -CREATE INDEX "view_limit_idx_view_id" on "view_limit" ("view_id"); - -; --- --- Table: widget --- -CREATE TABLE "widget" ( - "id" serial NOT NULL, - "grid_id" character varying(64), - "dashboard_id" integer, - "type" character varying(16), - "title" text, - "static" smallint DEFAULT 0 NOT NULL, - "h" smallint DEFAULT 0, - "w" smallint DEFAULT 0, - "x" smallint DEFAULT 0, - "y" smallint DEFAULT 0, - "content" text, - "view_id" integer, - "graph_id" integer, - "rows" integer, - "tl_options" text, - "globe_options" text, - PRIMARY KEY ("id"), - CONSTRAINT "widget_ux_dashboard_grid" UNIQUE ("dashboard_id", "grid_id") -); -CREATE INDEX "widget_idx_dashboard_id" on "widget" ("dashboard_id"); -CREATE INDEX "widget_idx_graph_id" on "widget" ("graph_id"); -CREATE INDEX "widget_idx_view_id" on "widget" ("view_id"); - -; --- --- Foreign Key Definitions --- - -; -ALTER TABLE "alert" ADD CONSTRAINT "alert_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert" ADD CONSTRAINT "alert_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_cache" ADD CONSTRAINT "alert_cache_fk_current_id" FOREIGN KEY ("current_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_cache" ADD CONSTRAINT "alert_cache_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_cache" ADD CONSTRAINT "alert_cache_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_cache" ADD CONSTRAINT "alert_cache_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_column" ADD CONSTRAINT "alert_column_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_column" ADD CONSTRAINT "alert_column_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_send" ADD CONSTRAINT "alert_send_fk_alert_id" FOREIGN KEY ("alert_id") - REFERENCES "alert" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_send" ADD CONSTRAINT "alert_send_fk_current_id" FOREIGN KEY ("current_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "alert_send" ADD CONSTRAINT "alert_send_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "audit" ADD CONSTRAINT "audit_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "audit" ADD CONSTRAINT "audit_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "audit" ADD CONSTRAINT "audit_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "authentication" ADD CONSTRAINT "authentication_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "calc" ADD CONSTRAINT "calc_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "calcval" ADD CONSTRAINT "calcval_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "calcval" ADD CONSTRAINT "calcval_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "current" ADD CONSTRAINT "current_fk_deletedby" FOREIGN KEY ("deletedby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "current" ADD CONSTRAINT "current_fk_draftuser_id" FOREIGN KEY ("draftuser_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "current" ADD CONSTRAINT "current_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "current" ADD CONSTRAINT "current_fk_linked_id" FOREIGN KEY ("linked_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "current" ADD CONSTRAINT "current_fk_parent_id" FOREIGN KEY ("parent_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "curval" ADD CONSTRAINT "curval_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "curval" ADD CONSTRAINT "curval_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "curval" ADD CONSTRAINT "curval_fk_value" FOREIGN KEY ("value") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "curval_fields" ADD CONSTRAINT "curval_fields_fk_child_id" FOREIGN KEY ("child_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "curval_fields" ADD CONSTRAINT "curval_fields_fk_parent_id" FOREIGN KEY ("parent_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "dashboard" ADD CONSTRAINT "dashboard_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "dashboard" ADD CONSTRAINT "dashboard_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "dashboard" ADD CONSTRAINT "dashboard_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "date" ADD CONSTRAINT "date_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "date" ADD CONSTRAINT "date_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "daterange" ADD CONSTRAINT "daterange_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "daterange" ADD CONSTRAINT "daterange_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "department" ADD CONSTRAINT "department_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "display_field" ADD CONSTRAINT "display_field_fk_display_field_id" FOREIGN KEY ("display_field_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "display_field" ADD CONSTRAINT "display_field_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "enum" ADD CONSTRAINT "enum_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "enum" ADD CONSTRAINT "enum_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "enum" ADD CONSTRAINT "enum_fk_value" FOREIGN KEY ("value") - REFERENCES "enumval" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "enumval" ADD CONSTRAINT "enumval_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "enumval" ADD CONSTRAINT "enumval_fk_parent" FOREIGN KEY ("parent") - REFERENCES "enumval" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "export" ADD CONSTRAINT "export_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "export" ADD CONSTRAINT "export_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "file" ADD CONSTRAINT "file_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "file" ADD CONSTRAINT "file_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "file" ADD CONSTRAINT "file_fk_value" FOREIGN KEY ("value") - REFERENCES "fileval" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "file_option" ADD CONSTRAINT "file_option_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "fileval" ADD CONSTRAINT "fileval_fk_edit_user_id" FOREIGN KEY ("edit_user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "filter" ADD CONSTRAINT "filter_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "filter" ADD CONSTRAINT "filter_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "filtered_value" ADD CONSTRAINT "filtered_value_fk_current_id" FOREIGN KEY ("current_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "filtered_value" ADD CONSTRAINT "filtered_value_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "filtered_value" ADD CONSTRAINT "filtered_value_fk_submission_id" FOREIGN KEY ("submission_id") - REFERENCES "submission" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_group_id" FOREIGN KEY ("group_id") - REFERENCES "group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_group_by" FOREIGN KEY ("group_by") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_metric_group" FOREIGN KEY ("metric_group") - REFERENCES "metric_group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_x_axis" FOREIGN KEY ("x_axis") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_x_axis_link" FOREIGN KEY ("x_axis_link") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "graph" ADD CONSTRAINT "graph_fk_y_axis" FOREIGN KEY ("y_axis") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "group" ADD CONSTRAINT "group_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "import" ADD CONSTRAINT "import_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "import" ADD CONSTRAINT "import_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "import" ADD CONSTRAINT "import_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "import_row" ADD CONSTRAINT "import_row_fk_import_id" FOREIGN KEY ("import_id") - REFERENCES "import" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance" ADD CONSTRAINT "instance_fk_api_index_layout_id" FOREIGN KEY ("api_index_layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance" ADD CONSTRAINT "instance_fk_default_view_limit_extra_id" FOREIGN KEY ("default_view_limit_extra_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance" ADD CONSTRAINT "instance_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance" ADD CONSTRAINT "instance_fk_sort_layout_id" FOREIGN KEY ("sort_layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance" ADD CONSTRAINT "instance_fk_view_limit_id" FOREIGN KEY ("view_limit_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance_group" ADD CONSTRAINT "instance_group_fk_group_id" FOREIGN KEY ("group_id") - REFERENCES "group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance_group" ADD CONSTRAINT "instance_group_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "instance_rag" ADD CONSTRAINT "instance_rag_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "intgr" ADD CONSTRAINT "intgr_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "intgr" ADD CONSTRAINT "intgr_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout" ADD CONSTRAINT "layout_fk_display_field" FOREIGN KEY ("display_field") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout" ADD CONSTRAINT "layout_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout" ADD CONSTRAINT "layout_fk_link_parent" FOREIGN KEY ("link_parent") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout" ADD CONSTRAINT "layout_fk_related_field" FOREIGN KEY ("related_field") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout" ADD CONSTRAINT "layout_fk_topic_id" FOREIGN KEY ("topic_id") - REFERENCES "topic" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout_depend" ADD CONSTRAINT "layout_depend_fk_depends_on" FOREIGN KEY ("depends_on") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout_depend" ADD CONSTRAINT "layout_depend_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout_group" ADD CONSTRAINT "layout_group_fk_group_id" FOREIGN KEY ("group_id") - REFERENCES "group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "layout_group" ADD CONSTRAINT "layout_group_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "metric" ADD CONSTRAINT "metric_fk_metric_group" FOREIGN KEY ("metric_group") - REFERENCES "metric_group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "metric_group" ADD CONSTRAINT "metric_group_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "oauthtoken" ADD CONSTRAINT "oauthtoken_fk_oauthclient_id" FOREIGN KEY ("oauthclient_id") - REFERENCES "oauthclient" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "oauthtoken" ADD CONSTRAINT "oauthtoken_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "organisation" ADD CONSTRAINT "organisation_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "person" ADD CONSTRAINT "person_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "person" ADD CONSTRAINT "person_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "person" ADD CONSTRAINT "person_fk_value" FOREIGN KEY ("value") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "rag" ADD CONSTRAINT "rag_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "ragval" ADD CONSTRAINT "ragval_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "ragval" ADD CONSTRAINT "ragval_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "record" ADD CONSTRAINT "record_fk_approvedby" FOREIGN KEY ("approvedby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "record" ADD CONSTRAINT "record_fk_createdby" FOREIGN KEY ("createdby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "record" ADD CONSTRAINT "record_fk_current_id" FOREIGN KEY ("current_id") - REFERENCES "current" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "record" ADD CONSTRAINT "record_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_createdby" FOREIGN KEY ("createdby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report_instance" ADD CONSTRAINT "report_instance_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report_instance" ADD CONSTRAINT "report_instance_fk_report_id" FOREIGN KEY ("report_id") - REFERENCES "report" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "sort" ADD CONSTRAINT "sort_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "sort" ADD CONSTRAINT "sort_fk_parent_id" FOREIGN KEY ("parent_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "sort" ADD CONSTRAINT "sort_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "string" ADD CONSTRAINT "string_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "string" ADD CONSTRAINT "string_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "team" ADD CONSTRAINT "team_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "title" ADD CONSTRAINT "title_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "topic" ADD CONSTRAINT "topic_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "topic" ADD CONSTRAINT "topic_fk_prevent_edit_topic_id" FOREIGN KEY ("prevent_edit_topic_id") - REFERENCES "topic" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_department_id" FOREIGN KEY ("department_id") - REFERENCES "department" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_lastrecord" FOREIGN KEY ("lastrecord") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_lastview" FOREIGN KEY ("lastview") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_limit_to_view" FOREIGN KEY ("limit_to_view") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_organisation" FOREIGN KEY ("organisation") - REFERENCES "organisation" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_site_id" FOREIGN KEY ("site_id") - REFERENCES "site" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_team_id" FOREIGN KEY ("team_id") - REFERENCES "team" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user" ADD CONSTRAINT "user_fk_title" FOREIGN KEY ("title") - REFERENCES "title" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_graph" ADD CONSTRAINT "user_graph_fk_graph_id" FOREIGN KEY ("graph_id") - REFERENCES "graph" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_graph" ADD CONSTRAINT "user_graph_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_group" ADD CONSTRAINT "user_group_fk_group_id" FOREIGN KEY ("group_id") - REFERENCES "group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_group" ADD CONSTRAINT "user_group_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_lastrecord" ADD CONSTRAINT "user_lastrecord_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_lastrecord" ADD CONSTRAINT "user_lastrecord_fk_record_id" FOREIGN KEY ("record_id") - REFERENCES "record" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_lastrecord" ADD CONSTRAINT "user_lastrecord_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_permission" ADD CONSTRAINT "user_permission_fk_permission_id" FOREIGN KEY ("permission_id") - REFERENCES "permission" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "user_permission" ADD CONSTRAINT "user_permission_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view" ADD CONSTRAINT "view_fk_createdby" FOREIGN KEY ("createdby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view" ADD CONSTRAINT "view_fk_group_id" FOREIGN KEY ("group_id") - REFERENCES "group" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view" ADD CONSTRAINT "view_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view" ADD CONSTRAINT "view_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_group" ADD CONSTRAINT "view_group_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_group" ADD CONSTRAINT "view_group_fk_parent_id" FOREIGN KEY ("parent_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_group" ADD CONSTRAINT "view_group_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_layout" ADD CONSTRAINT "view_layout_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_layout" ADD CONSTRAINT "view_layout_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_limit" ADD CONSTRAINT "view_limit_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "view_limit" ADD CONSTRAINT "view_limit_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "widget" ADD CONSTRAINT "widget_fk_dashboard_id" FOREIGN KEY ("dashboard_id") - REFERENCES "dashboard" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "widget" ADD CONSTRAINT "widget_fk_graph_id" FOREIGN KEY ("graph_id") - REFERENCES "graph" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "widget" ADD CONSTRAINT "widget_fk_view_id" FOREIGN KEY ("view_id") - REFERENCES "view" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; diff --git a/share/migrations/PostgreSQL/downgrade/101-100/001-auto.sql b/share/migrations/PostgreSQL/downgrade/101-100/001-auto.sql deleted file mode 100644 index 7932ae355..000000000 --- a/share/migrations/PostgreSQL/downgrade/101-100/001-auto.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Convert schema '/home/droberts/source/gads/share/migrations/_source/deploy/101/001-auto.yml' to '/home/droberts/source/gads/share/migrations/_source/deploy/100/001-auto.yml':; - -; -BEGIN; - -; -DROP TABLE report CASCADE; - -; -DROP TABLE report_instance CASCADE; - -; - -COMMIT; - diff --git a/share/migrations/PostgreSQL/upgrade/100-101/001-auto.sql b/share/migrations/PostgreSQL/upgrade/100-101/001-auto.sql deleted file mode 100644 index a1f5117c3..000000000 --- a/share/migrations/PostgreSQL/upgrade/100-101/001-auto.sql +++ /dev/null @@ -1,55 +0,0 @@ --- Convert schema '/home/droberts/source/gads/share/migrations/_source/deploy/100/001-auto.yml' to '/home/droberts/source/gads/share/migrations/_source/deploy/101/001-auto.yml':; - -; -BEGIN; - -; -CREATE TABLE "report" ( - "id" bigserial NOT NULL, - "name" character varying(128) NOT NULL, - "description" character varying(128), - "user_id" bigint, - "createdby" bigint, - "created" timestamp, - "instance_id" bigint, - PRIMARY KEY ("id") -); -CREATE INDEX "report_idx_createdby" on "report" ("createdby"); -CREATE INDEX "report_idx_instance_id" on "report" ("instance_id"); -CREATE INDEX "report_idx_user_id" on "report" ("user_id"); - -; -CREATE TABLE "report_instance" ( - "id" serial NOT NULL, - "report_id" integer NOT NULL, - "layout_id" bigint NOT NULL, - "order" integer, - PRIMARY KEY ("id") -); -CREATE INDEX "report_instance_idx_layout_id" on "report_instance" ("layout_id"); -CREATE INDEX "report_instance_idx_report_id" on "report_instance" ("report_id"); - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_createdby" FOREIGN KEY ("createdby") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_instance_id" FOREIGN KEY ("instance_id") - REFERENCES "instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report" ADD CONSTRAINT "report_fk_user_id" FOREIGN KEY ("user_id") - REFERENCES "user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report_instance" ADD CONSTRAINT "report_instance_fk_layout_id" FOREIGN KEY ("layout_id") - REFERENCES "layout" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; -ALTER TABLE "report_instance" ADD CONSTRAINT "report_instance_fk_report_id" FOREIGN KEY ("report_id") - REFERENCES "report" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE; - -; - -COMMIT; - diff --git a/share/migrations/_source/deploy/101/001-auto-__VERSION.yml b/share/migrations/_source/deploy/101/001-auto-__VERSION.yml deleted file mode 100644 index abd02b2a2..000000000 --- a/share/migrations/_source/deploy/101/001-auto-__VERSION.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -schema: - procedures: {} - tables: - dbix_class_deploymenthandler_versions: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - version - match_type: '' - name: dbix_class_deploymenthandler_versions_version - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - fields: - ddl: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: ddl - order: 3 - size: - - 0 - id: - data_type: int - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - upgrade_sql: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: upgrade_sql - order: 4 - size: - - 0 - version: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: version - order: 2 - size: - - 50 - indices: [] - name: dbix_class_deploymenthandler_versions - options: [] - order: 1 - triggers: {} - views: {} -translator: - add_drop_table: 0 - filename: ~ - no_comments: 0 - parser_args: - sources: - - __VERSION - parser_type: SQL::Translator::Parser::DBIx::Class - producer_args: - mysql_version: 5.7 - producer_type: SQL::Translator::Producer::YAML - show_warnings: 0 - trace: 0 - version: 1.63 diff --git a/share/migrations/_source/deploy/101/001-auto.yml b/share/migrations/_source/deploy/101/001-auto.yml deleted file mode 100644 index a95d18d91..000000000 --- a/share/migrations/_source/deploy/101/001-auto.yml +++ /dev/null @@ -1,8989 +0,0 @@ ---- -schema: - procedures: {} - tables: - alert: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: alert_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: alert_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - frequency: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: frequency - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 3 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - user_id - name: alert_idx_user_id - options: [] - type: NORMAL - - fields: - - view_id - name: alert_idx_view_id - options: [] - type: NORMAL - name: alert - options: [] - order: 1 - alert_cache: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - current_id - match_type: '' - name: alert_cache_fk_current_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: alert_cache_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: alert_cache_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: alert_cache_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - current_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: current_id - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 5 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 3 - size: - - 0 - indices: - - fields: - - current_id - name: alert_cache_idx_current_id - options: [] - type: NORMAL - - fields: - - layout_id - name: alert_cache_idx_layout_id - options: [] - type: NORMAL - - fields: - - user_id - name: alert_cache_idx_user_id - options: [] - type: NORMAL - - fields: - - view_id - name: alert_cache_idx_view_id - options: [] - type: NORMAL - name: alert_cache - options: [] - order: 2 - alert_column: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: alert_column_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: alert_column_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 3 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - indices: - - fields: - - instance_id - name: alert_column_idx_instance_id - options: [] - type: NORMAL - - fields: - - layout_id - name: alert_column_idx_layout_id - options: [] - type: NORMAL - name: alert_column - options: [] - order: 3 - alert_send: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - - alert_id - - current_id - - status - match_type: '' - name: alert_send_all - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - alert_id - match_type: '' - name: alert_send_fk_alert_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: alert - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - current_id - match_type: '' - name: alert_send_fk_current_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: alert_send_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - alert_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: alert_id - order: 3 - size: - - 0 - current_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: current_id - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: layout_id - order: 2 - size: - - 0 - status: - data_type: char - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: status - order: 5 - size: - - 7 - indices: - - fields: - - alert_id - name: alert_send_idx_alert_id - options: [] - type: NORMAL - - fields: - - current_id - name: alert_send_idx_current_id - options: [] - type: NORMAL - - fields: - - layout_id - name: alert_send_idx_layout_id - options: [] - type: NORMAL - name: alert_send - options: [] - order: 4 - audit: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: audit_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: audit_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: audit_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - datetime: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: datetime - order: 5 - size: - - 0 - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 8 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 9 - size: - - 0 - method: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: method - order: 6 - size: - - 45 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 4 - size: - - 45 - url: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: url - order: 7 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 3 - size: - - 0 - indices: - - fields: - - instance_id - name: audit_idx_instance_id - options: [] - type: NORMAL - - fields: - - site_id - name: audit_idx_site_id - options: [] - type: NORMAL - - fields: - - user_id - name: audit_idx_user_id - options: [] - type: NORMAL - - fields: - - datetime - name: audit_idx_datetime - options: [] - type: NORMAL - name: audit - options: [] - order: 5 - authentication: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: authentication_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - enabled: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: enabled - order: 8 - size: - - 0 - error_messages: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: error_messages - order: 9 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 4 - size: - - 0 - saml2_firstname: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: saml2_firstname - order: 6 - size: - - 0 - saml2_surname: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: saml2_surname - order: 7 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 3 - size: - - 32 - xml: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: xml - order: 5 - size: - - 0 - indices: - - fields: - - site_id - name: authentication_idx_site_id - options: [] - type: NORMAL - name: authentication - options: [] - order: 6 - calc: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: calc_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - calc: - data_type: mediumtext - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: calc - order: 3 - size: - - 0 - code: - data_type: mediumtext - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: code - order: 4 - size: - - 0 - decimal_places: - data_type: smallint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: decimal_places - order: 6 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - return_format: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: return_format - order: 5 - size: - - 45 - indices: - - fields: - - layout_id - name: calc_idx_layout_id - options: [] - type: NORMAL - name: calc - options: [] - order: 7 - calcval: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: calcval_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: calcval_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value_date: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_date - order: 6 - size: - - 0 - value_date_from: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_date_from - order: 8 - size: - - 0 - value_date_to: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_date_to - order: 9 - size: - - 0 - value_int: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_int - order: 5 - size: - - 0 - value_numeric: - data_type: decimal - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_numeric - order: 7 - size: - - 20 - - 5 - value_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_text - order: 4 - size: - - 0 - indices: - - fields: - - layout_id - name: calcval_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: calcval_idx_record_id - options: [] - type: NORMAL - - fields: - - name: value_text - prefix_length: 64 - name: calcval_idx_value_text - options: [] - type: NORMAL - - fields: - - value_numeric - name: calcval_idx_value_numeric - options: [] - type: NORMAL - - fields: - - value_int - name: calcval_idx_value_int - options: [] - type: NORMAL - - fields: - - value_date - name: calcval_idx_value_date - options: [] - type: NORMAL - name: calcval - options: [] - order: 8 - current: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - - serial - match_type: '' - name: current_ux_instance_serial - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - deletedby - match_type: '' - name: current_fk_deletedby - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - draftuser_id - match_type: '' - name: current_fk_draftuser_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: current_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - linked_id - match_type: '' - name: current_fk_linked_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - parent_id - match_type: '' - name: current_fk_parent_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - fields: - deleted: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 6 - size: - - 0 - deletedby: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: deletedby - order: 7 - size: - - 0 - draftuser_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: draftuser_id - order: 8 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: instance_id - order: 4 - size: - - 0 - linked_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: linked_id - order: 5 - size: - - 0 - parent_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: parent_id - order: 3 - size: - - 0 - serial: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: serial - order: 2 - size: - - 0 - indices: - - fields: - - deletedby - name: current_idx_deletedby - options: [] - type: NORMAL - - fields: - - draftuser_id - name: current_idx_draftuser_id - options: [] - type: NORMAL - - fields: - - instance_id - name: current_idx_instance_id - options: [] - type: NORMAL - - fields: - - linked_id - name: current_idx_linked_id - options: [] - type: NORMAL - - fields: - - parent_id - name: current_idx_parent_id - options: [] - type: NORMAL - name: current - options: [] - order: 9 - curval: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: curval_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: curval_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - value - match_type: '' - name: curval_fk_value - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: curval_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: curval_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: curval_idx_value - options: [] - type: NORMAL - name: curval - options: [] - order: 10 - curval_fields: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - child_id - match_type: '' - name: curval_fields_fk_child_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - parent_id - match_type: '' - name: curval_fields_fk_parent_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - child_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_id - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - parent_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: parent_id - order: 2 - size: - - 0 - indices: - - fields: - - child_id - name: curval_fields_idx_child_id - options: [] - type: NORMAL - - fields: - - parent_id - name: curval_fields_idx_parent_id - options: [] - type: NORMAL - name: curval_fields - options: [] - order: 11 - dashboard: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: dashboard_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: dashboard_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: dashboard_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 3 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - user_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 4 - size: - - 0 - indices: - - fields: - - instance_id - name: dashboard_idx_instance_id - options: [] - type: NORMAL - - fields: - - site_id - name: dashboard_idx_site_id - options: [] - type: NORMAL - - fields: - - user_id - name: dashboard_idx_user_id - options: [] - type: NORMAL - name: dashboard - options: [] - order: 12 - date: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: date_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: date_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: date_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: date_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: date_idx_value - options: [] - type: NORMAL - name: date - options: [] - order: 13 - daterange: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: daterange_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: daterange_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 6 - size: - - 0 - from: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: from - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - to: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: to - order: 5 - size: - - 0 - value: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 7 - size: - - 45 - indices: - - fields: - - layout_id - name: daterange_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: daterange_idx_record_id - options: [] - type: NORMAL - - fields: - - from - name: daterange_idx_from - options: [] - type: NORMAL - - fields: - - to - name: daterange_idx_to - options: [] - type: NORMAL - - fields: - - value - name: daterange_idx_value - options: [] - type: NORMAL - name: daterange - options: [] - order: 14 - department: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: department_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - deleted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 3 - size: - - 0 - indices: - - fields: - - site_id - name: department_idx_site_id - options: [] - type: NORMAL - name: department - options: [] - order: 15 - display_field: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - display_field_id - match_type: '' - name: display_field_fk_display_field_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: display_field_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - display_field_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: display_field_id - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - operator: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: operator - order: 5 - size: - - 16 - regex: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: regex - order: 4 - size: - - 0 - indices: - - fields: - - display_field_id - name: display_field_idx_display_field_id - options: [] - type: NORMAL - - fields: - - layout_id - name: display_field_idx_layout_id - options: [] - type: NORMAL - name: display_field - options: [] - order: 16 - enum: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: enum_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: enum_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - value - match_type: '' - name: enum_fk_value - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: enumval - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: enum_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: enum_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: enum_idx_value - options: [] - type: NORMAL - name: enum - options: [] - order: 17 - enumval: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: enumval_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - parent - match_type: '' - name: enumval_fk_parent - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: enumval - type: FOREIGN KEY - fields: - deleted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - parent: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: parent - order: 5 - size: - - 0 - position: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: position - order: 6 - size: - - 0 - value: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: enumval_idx_layout_id - options: [] - type: NORMAL - - fields: - - parent - name: enumval_idx_parent - options: [] - type: NORMAL - - fields: - - name: value - prefix_length: 64 - name: enumval_idx_value - options: [] - type: NORMAL - name: enumval - options: [] - order: 18 - export: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: export_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: export_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - completed: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: completed - order: 6 - size: - - 0 - content: - data_type: longblob - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: content - order: 10 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - mimetype: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: mimetype - order: 9 - size: - - 0 - result: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: result - order: 7 - size: - - 0 - result_internal: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: result_internal - order: 8 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - started: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: started - order: 5 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 4 - size: - - 45 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 3 - size: - - 0 - indices: - - fields: - - site_id - name: export_idx_site_id - options: [] - type: NORMAL - - fields: - - user_id - name: export_idx_user_id - options: [] - type: NORMAL - name: export - options: [] - order: 19 - file: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: file_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: file_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - value - match_type: '' - name: file_fk_value - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: fileval - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: file_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: file_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: file_idx_value - options: [] - type: NORMAL - name: file - options: [] - order: 20 - file_option: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: file_option_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - filesize: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: filesize - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: file_option_idx_layout_id - options: [] - type: NORMAL - name: file_option - options: [] - order: 21 - fileval: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - edit_user_id - match_type: '' - name: fileval_fk_edit_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - content: - data_type: longblob - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: content - order: 4 - size: - - 0 - edit_user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: edit_user_id - order: 6 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - is_independent: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: is_independent - order: 5 - size: - - 0 - mimetype: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: mimetype - order: 3 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 0 - indices: - - fields: - - edit_user_id - name: fileval_idx_edit_user_id - options: [] - type: NORMAL - - fields: - - name: name - prefix_length: 64 - name: fileval_idx_name - options: [] - type: NORMAL - name: fileval - options: [] - order: 22 - filter: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: filter_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: filter_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: filter_idx_layout_id - options: [] - type: NORMAL - - fields: - - view_id - name: filter_idx_view_id - options: [] - type: NORMAL - name: filter - options: [] - order: 23 - filtered_value: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - submission_id - - layout_id - - current_id - match_type: '' - name: ux_submission_layout_current - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - current_id - match_type: '' - name: filtered_value_fk_current_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: filtered_value_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - submission_id - match_type: '' - name: filtered_value_fk_submission_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: submission - type: FOREIGN KEY - fields: - current_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: current_id - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: layout_id - order: 3 - size: - - 0 - submission_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: submission_id - order: 2 - size: - - 0 - indices: - - fields: - - current_id - name: filtered_value_idx_current_id - options: [] - type: NORMAL - - fields: - - layout_id - name: filtered_value_idx_layout_id - options: [] - type: NORMAL - - fields: - - submission_id - name: filtered_value_idx_submission_id - options: [] - type: NORMAL - name: filtered_value - options: [] - order: 24 - graph: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - group_id - match_type: '' - name: graph_fk_group_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - group_by - match_type: '' - name: graph_fk_group_by - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: graph_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - metric_group - match_type: '' - name: graph_fk_metric_group - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: metric_group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: graph_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - x_axis - match_type: '' - name: graph_fk_x_axis - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - x_axis_link - match_type: '' - name: graph_fk_x_axis_link - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - y_axis - match_type: '' - name: graph_fk_y_axis - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - as_percent: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: as_percent - order: 12 - size: - - 0 - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 3 - size: - - 0 - from: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: from - order: 20 - size: - - 0 - group_by: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: group_by - order: 10 - size: - - 0 - group_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: group_id - order: 18 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 15 - size: - - 0 - is_shared: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: is_shared - order: 16 - size: - - 0 - metric_group: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: metric_group - order: 14 - size: - - 0 - stackseries: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: stackseries - order: 11 - size: - - 0 - title: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: title - order: 2 - size: - - 0 - to: - data_type: date - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: to - order: 21 - size: - - 0 - trend: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: trend - order: 19 - size: - - 45 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 13 - size: - - 45 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 17 - size: - - 0 - x_axis: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x_axis - order: 7 - size: - - 0 - x_axis_grouping: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x_axis_grouping - order: 9 - size: - - 45 - x_axis_link: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x_axis_link - order: 8 - size: - - 0 - x_axis_range: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x_axis_range - order: 22 - size: - - 45 - y_axis: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: y_axis - order: 4 - size: - - 0 - y_axis_label: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: y_axis_label - order: 6 - size: - - 0 - y_axis_stack: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: y_axis_stack - order: 5 - size: - - 45 - indices: - - fields: - - group_id - name: graph_idx_group_id - options: [] - type: NORMAL - - fields: - - group_by - name: graph_idx_group_by - options: [] - type: NORMAL - - fields: - - instance_id - name: graph_idx_instance_id - options: [] - type: NORMAL - - fields: - - metric_group - name: graph_idx_metric_group - options: [] - type: NORMAL - - fields: - - user_id - name: graph_idx_user_id - options: [] - type: NORMAL - - fields: - - x_axis - name: graph_idx_x_axis - options: [] - type: NORMAL - - fields: - - x_axis_link - name: graph_idx_x_axis_link - options: [] - type: NORMAL - - fields: - - y_axis - name: graph_idx_y_axis - options: [] - type: NORMAL - name: graph - options: [] - order: 25 - graph_color: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - name - match_type: '' - name: ux_graph_color_name - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - fields: - color: - data_type: char - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: color - order: 3 - size: - - 6 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: name - order: 2 - size: - - 128 - indices: [] - name: graph_color - options: [] - order: 26 - group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: group_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - default_approve_existing: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_approve_existing - order: 7 - size: - - 0 - default_approve_new: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_approve_new - order: 6 - size: - - 0 - default_read: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_read - order: 3 - size: - - 0 - default_write_existing: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_write_existing - order: 5 - size: - - 0 - default_write_existing_no_approval: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_write_existing_no_approval - order: 9 - size: - - 0 - default_write_new: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_write_new - order: 4 - size: - - 0 - default_write_new_no_approval: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: default_write_new_no_approval - order: 8 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 10 - size: - - 0 - indices: - - fields: - - site_id - name: group_idx_site_id - options: [] - type: NORMAL - name: group - options: [] - order: 27 - import: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: import_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: import_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: import_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - completed: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: completed - order: 8 - size: - - 0 - error_count: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: error_count - order: 10 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 3 - size: - - 0 - result: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: result - order: 12 - size: - - 0 - row_count: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: row_count - order: 6 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - skipped_count: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: skipped_count - order: 11 - size: - - 0 - started: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: started - order: 7 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 5 - size: - - 45 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 4 - size: - - 0 - written_count: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: written_count - order: 9 - size: - - 0 - indices: - - fields: - - instance_id - name: import_idx_instance_id - options: [] - type: NORMAL - - fields: - - site_id - name: import_idx_site_id - options: [] - type: NORMAL - - fields: - - user_id - name: import_idx_user_id - options: [] - type: NORMAL - name: import - options: [] - order: 28 - import_row: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - import_id - match_type: '' - name: import_row_fk_import_id - on_delete: CASCADE - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: import - type: FOREIGN KEY - fields: - changes: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: changes - order: 6 - size: - - 0 - content: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: content - order: 4 - size: - - 0 - errors: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: errors - order: 5 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - import_id: - data_type: int - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: import_id - order: 2 - size: - - 0 - status: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: status - order: 3 - size: - - 45 - indices: - - fields: - - import_id - name: import_row_idx_import_id - options: [] - type: NORMAL - name: import_row - options: [] - order: 29 - instance: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - api_index_layout_id - match_type: '' - name: instance_fk_api_index_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - default_view_limit_extra_id - match_type: '' - name: instance_fk_default_view_limit_extra_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: instance_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - sort_layout_id - match_type: '' - name: instance_fk_sort_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_limit_id - match_type: '' - name: instance_fk_view_limit_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - api_index_layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: api_index_layout_id - order: 14 - size: - - 0 - default_view_limit_extra_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: default_view_limit_extra_id - order: 8 - size: - - 0 - forget_history: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: forget_history - order: 12 - size: - - 0 - forward_record_after_create: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: forward_record_after_create - order: 15 - size: - - 0 - hide_in_selector: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: hide_in_selector - order: 19 - size: - - 0 - homepage_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: homepage_text - order: 9 - size: - - 0 - homepage_text2: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: homepage_text2 - order: 10 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 0 - name_short: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name_short - order: 3 - size: - - 64 - no_copy_record: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: no_copy_record - order: 18 - size: - - 0 - no_download_pdf: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: no_download_pdf - order: 17 - size: - - 0 - no_hide_blank: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: no_hide_blank - order: 16 - size: - - 0 - no_overnight_update: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: no_overnight_update - order: 13 - size: - - 0 - record_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_name - order: 11 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 4 - size: - - 0 - sort_layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: sort_layout_id - order: 5 - size: - - 0 - sort_type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: sort_type - order: 6 - size: - - 45 - view_limit_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: view_limit_id - order: 7 - size: - - 0 - indices: - - fields: - - api_index_layout_id - name: instance_idx_api_index_layout_id - options: [] - type: NORMAL - - fields: - - default_view_limit_extra_id - name: instance_idx_default_view_limit_extra_id - options: [] - type: NORMAL - - fields: - - site_id - name: instance_idx_site_id - options: [] - type: NORMAL - - fields: - - sort_layout_id - name: instance_idx_sort_layout_id - options: [] - type: NORMAL - - fields: - - view_limit_id - name: instance_idx_view_limit_id - options: [] - type: NORMAL - name: instance - options: [] - order: 30 - instance_group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - - group_id - - permission - match_type: '' - name: instance_group_ux_instance_group_permission - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - group_id - match_type: '' - name: instance_group_fk_group_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: instance_group_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - fields: - group_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: group_id - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: instance_id - order: 2 - size: - - 0 - permission: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: permission - order: 4 - size: - - 45 - indices: - - fields: - - group_id - name: instance_group_idx_group_id - options: [] - type: NORMAL - - fields: - - instance_id - name: instance_group_idx_instance_id - options: [] - type: NORMAL - name: instance_group - options: [] - order: 31 - instance_rag: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - - rag - match_type: '' - name: instance_rag_ux_instance_rag - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: instance_rag_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - fields: - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 5 - size: - - 0 - enabled: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: enabled - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: instance_id - order: 2 - size: - - 0 - rag: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: rag - order: 3 - size: - - 16 - indices: - - fields: - - instance_id - name: instance_rag_idx_instance_id - options: [] - type: NORMAL - name: instance_rag - options: [] - order: 32 - intgr: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: intgr_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: intgr_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: intgr_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: intgr_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: intgr_idx_value - options: [] - type: NORMAL - name: intgr - options: [] - order: 33 - layout: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - - name_short - match_type: '' - name: layout_ux_instance_name_short - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - display_field - match_type: '' - name: layout_fk_display_field - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: layout_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - link_parent - match_type: '' - name: layout_fk_link_parent - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - related_field - match_type: '' - name: layout_fk_related_field - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - topic_id - match_type: '' - name: layout_fk_topic_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: topic - type: FOREIGN KEY - fields: - aggregate: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: aggregate - order: 31 - size: - - 45 - can_child: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: can_child - order: 16 - size: - - 0 - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 18 - size: - - 0 - display_condition: - data_type: char - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: display_condition - order: 23 - size: - - 3 - display_field: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: display_field - order: 21 - size: - - 0 - display_matchtype: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: display_matchtype - order: 24 - size: - - 0 - display_regex: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: display_regex - order: 22 - size: - - 0 - end_node_only: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: end_node_only - order: 14 - size: - - 0 - filter: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: filter - order: 29 - size: - - 0 - force_regex: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: force_regex - order: 11 - size: - - 0 - group_display: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: group_display - order: 32 - size: - - 45 - helptext: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: helptext - order: 19 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: instance_id - order: 25 - size: - - 0 - internal: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: internal - order: 17 - size: - - 0 - isunique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: isunique - order: 8 - size: - - 0 - link_parent: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: link_parent - order: 26 - size: - - 0 - lookup_endpoint: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lookup_endpoint - order: 33 - size: - - 0 - lookup_group: - data_type: smallint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lookup_group - order: 34 - size: - - 0 - multivalue: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: multivalue - order: 15 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 0 - name_short: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: name_short - order: 3 - size: - - 64 - optional: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: optional - order: 6 - size: - - 0 - options: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: options - order: 20 - size: - - 0 - ordering: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: ordering - order: 13 - size: - - 45 - permission: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: permission - order: 5 - size: - - 0 - position: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: position - order: 12 - size: - - 0 - related_field: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: related_field - order: 27 - size: - - 0 - remember: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: remember - order: 7 - size: - - 0 - textbox: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: textbox - order: 9 - size: - - 0 - topic_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: topic_id - order: 30 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 4 - size: - - 45 - typeahead: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: typeahead - order: 10 - size: - - 0 - width: - data_type: integer - default_value: 50 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: width - order: 28 - size: - - 0 - indices: - - fields: - - display_field - name: layout_idx_display_field - options: [] - type: NORMAL - - fields: - - instance_id - name: layout_idx_instance_id - options: [] - type: NORMAL - - fields: - - link_parent - name: layout_idx_link_parent - options: [] - type: NORMAL - - fields: - - related_field - name: layout_idx_related_field - options: [] - type: NORMAL - - fields: - - topic_id - name: layout_idx_topic_id - options: [] - type: NORMAL - name: layout - options: [] - order: 34 - layout_depend: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - depends_on - match_type: '' - name: layout_depend_fk_depends_on - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: layout_depend_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - depends_on: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: depends_on - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - indices: - - fields: - - depends_on - name: layout_depend_idx_depends_on - options: [] - type: NORMAL - - fields: - - layout_id - name: layout_depend_idx_layout_id - options: [] - type: NORMAL - name: layout_depend - options: [] - order: 35 - layout_group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - - group_id - - permission - match_type: '' - name: layout_group_ux_layout_group_permission - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - group_id - match_type: '' - name: layout_group_fk_group_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: layout_group_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - group_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: group_id - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: layout_id - order: 2 - size: - - 0 - permission: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: permission - order: 4 - size: - - 45 - indices: - - fields: - - group_id - name: layout_group_idx_group_id - options: [] - type: NORMAL - - fields: - - layout_id - name: layout_group_idx_layout_id - options: [] - type: NORMAL - - fields: - - permission - name: layout_group_idx_permission - options: [] - type: NORMAL - name: layout_group - options: [] - order: 36 - metric: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - metric_group - match_type: '' - name: metric_fk_metric_group - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: metric_group - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - metric_group: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: metric_group - order: 2 - size: - - 0 - target: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: target - order: 4 - size: - - 0 - x_axis_value: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x_axis_value - order: 3 - size: - - 0 - y_axis_grouping_value: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: y_axis_grouping_value - order: 5 - size: - - 0 - indices: - - fields: - - metric_group - name: metric_idx_metric_group - options: [] - type: NORMAL - name: metric - options: [] - order: 37 - metric_group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: metric_group_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 3 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 0 - indices: - - fields: - - instance_id - name: metric_group_idx_instance_id - options: [] - type: NORMAL - name: metric_group - options: [] - order: 38 - oauthclient: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - fields: - client_id: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: client_id - order: 2 - size: - - 64 - client_secret: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: client_secret - order: 3 - size: - - 64 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - indices: [] - name: oauthclient - options: [] - order: 39 - oauthtoken: - constraints: - - deferrable: 1 - expression: '' - fields: - - token - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - oauthclient_id - match_type: '' - name: oauthtoken_fk_oauthclient_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: oauthclient - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: oauthtoken_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - expires: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: expires - order: 6 - size: - - 0 - oauthclient_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: oauthclient_id - order: 3 - size: - - 0 - related_token: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: related_token - order: 2 - size: - - 128 - token: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: token - order: 1 - size: - - 128 - type: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: type - order: 5 - size: - - 12 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 4 - size: - - 0 - indices: - - fields: - - oauthclient_id - name: oauthtoken_idx_oauthclient_id - options: [] - type: NORMAL - - fields: - - user_id - name: oauthtoken_idx_user_id - options: [] - type: NORMAL - name: oauthtoken - options: [] - order: 40 - organisation: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: organisation_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - deleted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 3 - size: - - 0 - indices: - - fields: - - site_id - name: organisation_idx_site_id - options: [] - type: NORMAL - name: organisation - options: [] - order: 41 - permission: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - fields: - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - order: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: order - order: 4 - size: - - 0 - indices: [] - name: permission - options: [] - order: 42 - person: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: person_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: person_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - value - match_type: '' - name: person_fk_value - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - indices: - - fields: - - layout_id - name: person_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: person_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: person_idx_value - options: [] - type: NORMAL - name: person - options: [] - order: 43 - rag: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: rag_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - fields: - amber: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: amber - order: 4 - size: - - 0 - code: - data_type: mediumtext - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: code - order: 6 - size: - - 0 - green: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: green - order: 5 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 2 - size: - - 0 - red: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: red - order: 3 - size: - - 0 - indices: - - fields: - - layout_id - name: rag_idx_layout_id - options: [] - type: NORMAL - name: rag - options: [] - order: 44 - ragval: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - record_id - - layout_id - match_type: '' - name: ragval_ux_record_layout - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: ragval_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: ragval_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: record_id - order: 2 - size: - - 0 - value: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 4 - size: - - 16 - indices: - - fields: - - layout_id - name: ragval_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: ragval_idx_record_id - options: [] - type: NORMAL - - fields: - - value - name: ragval_idx_value - options: [] - type: NORMAL - name: ragval - options: [] - order: 45 - record: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - approvedby - match_type: '' - name: record_fk_approvedby - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - createdby - match_type: '' - name: record_fk_createdby - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - current_id - match_type: '' - name: record_fk_current_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: current - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: record_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - approval: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: approval - order: 7 - size: - - 0 - approvedby: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: approvedby - order: 5 - size: - - 0 - created: - data_type: datetime - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: created - order: 2 - size: - - 0 - createdby: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: createdby - order: 4 - size: - - 0 - current_id: - data_type: bigint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: current_id - order: 3 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 6 - size: - - 0 - indices: - - fields: - - approvedby - name: record_idx_approvedby - options: [] - type: NORMAL - - fields: - - createdby - name: record_idx_createdby - options: [] - type: NORMAL - - fields: - - current_id - name: record_idx_current_id - options: [] - type: NORMAL - - fields: - - record_id - name: record_idx_record_id - options: [] - type: NORMAL - - fields: - - approval - name: record_idx_approval - options: [] - type: NORMAL - name: record - options: [] - order: 46 - report: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - createdby - match_type: '' - name: report_fk_createdby - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: report_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: report_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - created: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: created - order: 6 - size: - - 0 - createdby: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: createdby - order: 5 - size: - - 0 - description: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 3 - size: - - 128 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 7 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 4 - size: - - 0 - indices: - - fields: - - createdby - name: report_idx_createdby - options: [] - type: NORMAL - - fields: - - instance_id - name: report_idx_instance_id - options: [] - type: NORMAL - - fields: - - user_id - name: report_idx_user_id - options: [] - type: NORMAL - name: report - options: [] - order: 47 - report_instance: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: report_instance_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - report_id - match_type: '' - name: report_instance_fk_report_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: report - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - order: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: order - order: 4 - size: - - 0 - report_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: report_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: report_instance_idx_layout_id - options: [] - type: NORMAL - - fields: - - report_id - name: report_instance_idx_report_id - options: [] - type: NORMAL - name: report_instance - options: [] - order: 48 - site: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - fields: - account_request_notes_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: account_request_notes_name - order: 39 - size: - - 0 - account_request_notes_placeholder: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: account_request_notes_placeholder - order: 40 - size: - - 0 - created: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: created - order: 4 - size: - - 0 - email_delete_subject: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_delete_subject - order: 8 - size: - - 0 - email_delete_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_delete_text - order: 7 - size: - - 0 - email_reject_subject: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_reject_subject - order: 10 - size: - - 0 - email_reject_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_reject_text - order: 9 - size: - - 0 - email_welcome_subject: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_welcome_subject - order: 6 - size: - - 0 - email_welcome_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email_welcome_text - order: 5 - size: - - 0 - hide_account_request: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: hide_account_request - order: 34 - size: - - 0 - homepage_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: homepage_text - order: 12 - size: - - 0 - homepage_text2: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: homepage_text2 - order: 13 - size: - - 0 - host: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: host - order: 2 - size: - - 128 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 3 - size: - - 0 - register_department_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_department_help - order: 21 - size: - - 0 - register_department_mandatory: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_department_mandatory - order: 23 - size: - - 0 - register_department_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_department_name - order: 22 - size: - - 0 - register_email_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_email_help - order: 17 - size: - - 0 - register_freetext1_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext1_help - order: 15 - size: - - 0 - register_freetext1_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext1_name - order: 28 - size: - - 0 - register_freetext1_placeholder: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext1_placeholder - order: 37 - size: - - 0 - register_freetext2_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext2_help - order: 16 - size: - - 0 - register_freetext2_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext2_name - order: 29 - size: - - 0 - register_freetext2_placeholder: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_freetext2_placeholder - order: 38 - size: - - 0 - register_notes_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_notes_help - order: 27 - size: - - 0 - register_organisation_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_organisation_help - order: 18 - size: - - 0 - register_organisation_mandatory: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_organisation_mandatory - order: 20 - size: - - 0 - register_organisation_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_organisation_name - order: 19 - size: - - 0 - register_show_department: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_show_department - order: 31 - size: - - 0 - register_show_organisation: - data_type: smallint - default_value: 1 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_show_organisation - order: 30 - size: - - 0 - register_show_team: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_show_team - order: 32 - size: - - 0 - register_show_title: - data_type: smallint - default_value: 1 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_show_title - order: 33 - size: - - 0 - register_team_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_team_help - order: 24 - size: - - 0 - register_team_mandatory: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: register_team_mandatory - order: 26 - size: - - 0 - register_team_name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_team_name - order: 25 - size: - - 0 - register_text: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_text - order: 11 - size: - - 0 - register_title_help: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: register_title_help - order: 14 - size: - - 0 - remember_user_location: - data_type: smallint - default_value: 1 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: remember_user_location - order: 35 - size: - - 0 - user_editable_fields: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_editable_fields - order: 36 - size: - - 0 - indices: [] - name: site - options: [] - order: 49 - sort: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: sort_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - parent_id - match_type: '' - name: sort_fk_parent_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: sort_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - order: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: order - order: 6 - size: - - 0 - parent_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: parent_id - order: 4 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 5 - size: - - 45 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: sort_idx_layout_id - options: [] - type: NORMAL - - fields: - - parent_id - name: sort_idx_parent_id - options: [] - type: NORMAL - - fields: - - view_id - name: sort_idx_view_id - options: [] - type: NORMAL - name: sort - options: [] - order: 50 - string: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: string_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: string_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - fields: - child_unique: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: child_unique - order: 4 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - value: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 5 - size: - - 0 - value_index: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value_index - order: 6 - size: - - 128 - indices: - - fields: - - layout_id - name: string_idx_layout_id - options: [] - type: NORMAL - - fields: - - record_id - name: string_idx_record_id - options: [] - type: NORMAL - - fields: - - value_index - name: string_idx_value_index - options: [] - type: NORMAL - name: string - options: [] - order: 51 - submission: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - token - - submitted - match_type: '' - name: ux_submission_token - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - fields: - created: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: created - order: 3 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - submitted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: submitted - order: 4 - size: - - 0 - token: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 1 - name: token - order: 2 - size: - - 64 - indices: [] - name: submission - options: [] - order: 52 - team: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: team_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - deleted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 3 - size: - - 0 - indices: - - fields: - - site_id - name: team_idx_site_id - options: [] - type: NORMAL - name: team - options: [] - order: 53 - title: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: title_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - fields: - deleted: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 2 - size: - - 128 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 3 - size: - - 0 - indices: - - fields: - - site_id - name: title_idx_site_id - options: [] - type: NORMAL - name: title - options: [] - order: 54 - topic: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: topic_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - prevent_edit_topic_id - match_type: '' - name: topic_fk_prevent_edit_topic_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: topic - type: FOREIGN KEY - fields: - click_to_edit: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: click_to_edit - order: 6 - size: - - 0 - description: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: description - order: 4 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - initial_state: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: initial_state - order: 5 - size: - - 32 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 2 - size: - - 0 - name: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 3 - size: - - 0 - prevent_edit_topic_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: prevent_edit_topic_id - order: 7 - size: - - 0 - indices: - - fields: - - instance_id - name: topic_idx_instance_id - options: [] - type: NORMAL - - fields: - - prevent_edit_topic_id - name: topic_idx_prevent_edit_topic_id - options: [] - type: NORMAL - name: topic - options: [] - order: 55 - user: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - department_id - match_type: '' - name: user_fk_department_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: department - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - lastrecord - match_type: '' - name: user_fk_lastrecord - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - lastview - match_type: '' - name: user_fk_lastview - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - limit_to_view - match_type: '' - name: user_fk_limit_to_view - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - organisation - match_type: '' - name: user_fk_organisation - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: organisation - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - site_id - match_type: '' - name: user_fk_site_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: site - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - team_id - match_type: '' - name: user_fk_team_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: team - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - title - match_type: '' - name: user_fk_title - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: title - type: FOREIGN KEY - fields: - account_request: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: account_request - order: 24 - size: - - 0 - account_request_notes: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: account_request_notes - order: 25 - size: - - 0 - aup_accepted: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: aup_accepted - order: 26 - size: - - 0 - created: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: created - order: 29 - size: - - 0 - debug_login: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: debug_login - order: 30 - size: - - 0 - deleted: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: deleted - order: 16 - size: - - 0 - department_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: department_id - order: 9 - size: - - 0 - email: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: email - order: 5 - size: - - 0 - failcount: - data_type: integer - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: failcount - order: 19 - size: - - 0 - firstname: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: firstname - order: 3 - size: - - 128 - freetext1: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: freetext1 - order: 11 - size: - - 0 - freetext2: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: freetext2 - order: 12 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - lastfail: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lastfail - order: 18 - size: - - 0 - lastlogin: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lastlogin - order: 17 - size: - - 0 - lastrecord: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lastrecord - order: 20 - size: - - 0 - lastview: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: lastview - order: 21 - size: - - 0 - limit_to_view: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: limit_to_view - order: 27 - size: - - 0 - organisation: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: organisation - order: 8 - size: - - 0 - password: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: password - order: 13 - size: - - 128 - pwchanged: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: pwchanged - order: 14 - size: - - 0 - resetpw: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: resetpw - order: 15 - size: - - 32 - session_settings: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: session_settings - order: 22 - size: - - 0 - site_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: site_id - order: 2 - size: - - 0 - stylesheet: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: stylesheet - order: 28 - size: - - 0 - surname: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: surname - order: 4 - size: - - 128 - team_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: team_id - order: 10 - size: - - 0 - title: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: title - order: 7 - size: - - 0 - username: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: username - order: 6 - size: - - 0 - value: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: value - order: 23 - size: - - 0 - indices: - - fields: - - department_id - name: user_idx_department_id - options: [] - type: NORMAL - - fields: - - lastrecord - name: user_idx_lastrecord - options: [] - type: NORMAL - - fields: - - lastview - name: user_idx_lastview - options: [] - type: NORMAL - - fields: - - limit_to_view - name: user_idx_limit_to_view - options: [] - type: NORMAL - - fields: - - organisation - name: user_idx_organisation - options: [] - type: NORMAL - - fields: - - site_id - name: user_idx_site_id - options: [] - type: NORMAL - - fields: - - team_id - name: user_idx_team_id - options: [] - type: NORMAL - - fields: - - title - name: user_idx_title - options: [] - type: NORMAL - - fields: - - name: value - prefix_length: 64 - name: user_idx_value - options: [] - type: NORMAL - - fields: - - name: email - prefix_length: 64 - name: user_idx_email - options: [] - type: NORMAL - - fields: - - name: username - prefix_length: 64 - name: user_idx_username - options: [] - type: NORMAL - name: user - options: [] - order: 56 - user_graph: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - graph_id - match_type: '' - name: user_graph_fk_graph_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: graph - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: user_graph_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - graph_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: graph_id - order: 3 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 2 - size: - - 0 - indices: - - fields: - - graph_id - name: user_graph_idx_graph_id - options: [] - type: NORMAL - - fields: - - user_id - name: user_graph_idx_user_id - options: [] - type: NORMAL - name: user_graph - options: [] - order: 57 - user_group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - group_id - match_type: '' - name: user_group_fk_group_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: user_group_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - group_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: group_id - order: 3 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 2 - size: - - 0 - indices: - - fields: - - group_id - name: user_group_idx_group_id - options: [] - type: NORMAL - - fields: - - user_id - name: user_group_idx_user_id - options: [] - type: NORMAL - name: user_group - options: [] - order: 58 - user_lastrecord: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: user_lastrecord_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - record_id - match_type: '' - name: user_lastrecord_fk_record_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: record - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: user_lastrecord_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 3 - size: - - 0 - record_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: record_id - order: 2 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 4 - size: - - 0 - indices: - - fields: - - instance_id - name: user_lastrecord_idx_instance_id - options: [] - type: NORMAL - - fields: - - record_id - name: user_lastrecord_idx_record_id - options: [] - type: NORMAL - - fields: - - user_id - name: user_lastrecord_idx_user_id - options: [] - type: NORMAL - name: user_lastrecord - options: [] - order: 59 - user_permission: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - permission_id - match_type: '' - name: user_permission_fk_permission_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: permission - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: user_permission_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - permission_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: permission_id - order: 3 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 2 - size: - - 0 - indices: - - fields: - - permission_id - name: user_permission_idx_permission_id - options: [] - type: NORMAL - - fields: - - user_id - name: user_permission_idx_user_id - options: [] - type: NORMAL - name: user_permission - options: [] - order: 60 - view: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - createdby - match_type: '' - name: view_fk_createdby - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - group_id - match_type: '' - name: view_fk_group_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: group - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - instance_id - match_type: '' - name: view_fk_instance_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: instance - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: view_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - fields: - created: - data_type: datetime - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: created - order: 10 - size: - - 0 - createdby: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: createdby - order: 11 - size: - - 0 - filter: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: filter - order: 8 - size: - - 0 - global: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: global - order: 5 - size: - - 0 - group_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: group_id - order: 3 - size: - - 0 - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - instance_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: instance_id - order: 9 - size: - - 0 - is_admin: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: is_admin - order: 6 - size: - - 0 - is_limit_extra: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: is_limit_extra - order: 7 - size: - - 0 - name: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: name - order: 4 - size: - - 128 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 2 - size: - - 0 - indices: - - fields: - - createdby - name: view_idx_createdby - options: [] - type: NORMAL - - fields: - - group_id - name: view_idx_group_id - options: [] - type: NORMAL - - fields: - - instance_id - name: view_idx_instance_id - options: [] - type: NORMAL - - fields: - - user_id - name: view_idx_user_id - options: [] - type: NORMAL - name: view - options: [] - order: 61 - view_group: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: view_group_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - parent_id - match_type: '' - name: view_group_fk_parent_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: view_group_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - order: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: order - order: 5 - size: - - 0 - parent_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: parent_id - order: 4 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: view_group_idx_layout_id - options: [] - type: NORMAL - - fields: - - parent_id - name: view_group_idx_parent_id - options: [] - type: NORMAL - - fields: - - view_id - name: view_group_idx_view_id - options: [] - type: NORMAL - name: view_group - options: [] - order: 62 - view_layout: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - layout_id - match_type: '' - name: view_layout_fk_layout_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: layout - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: view_layout_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - layout_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: layout_id - order: 3 - size: - - 0 - order: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: order - order: 4 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - layout_id - name: view_layout_idx_layout_id - options: [] - type: NORMAL - - fields: - - view_id - name: view_layout_idx_view_id - options: [] - type: NORMAL - name: view_layout - options: [] - order: 63 - view_limit: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - user_id - match_type: '' - name: view_limit_fk_user_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: user - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: view_limit_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - id: - data_type: bigint - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - user_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: user_id - order: 3 - size: - - 0 - view_id: - data_type: bigint - default_value: ~ - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 2 - size: - - 0 - indices: - - fields: - - user_id - name: view_limit_idx_user_id - options: [] - type: NORMAL - - fields: - - view_id - name: view_limit_idx_view_id - options: [] - type: NORMAL - name: view_limit - options: [] - order: 64 - widget: - constraints: - - deferrable: 1 - expression: '' - fields: - - id - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - dashboard_id - - grid_id - match_type: '' - name: widget_ux_dashboard_grid - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: UNIQUE - - deferrable: 1 - expression: '' - fields: - - dashboard_id - match_type: '' - name: widget_fk_dashboard_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: dashboard - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - graph_id - match_type: '' - name: widget_fk_graph_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: graph - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - view_id - match_type: '' - name: widget_fk_view_id - on_delete: NO ACTION - on_update: NO ACTION - options: [] - reference_fields: - - id - reference_table: view - type: FOREIGN KEY - fields: - content: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: content - order: 11 - size: - - 0 - dashboard_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: dashboard_id - order: 3 - size: - - 0 - globe_options: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: globe_options - order: 16 - size: - - 0 - graph_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: graph_id - order: 13 - size: - - 0 - grid_id: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 1 - name: grid_id - order: 2 - size: - - 64 - h: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: h - order: 7 - size: - - 0 - id: - data_type: integer - default_value: ~ - is_auto_increment: 1 - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: id - order: 1 - size: - - 0 - rows: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: rows - order: 14 - size: - - 0 - static: - data_type: smallint - default_value: 0 - is_nullable: 0 - is_primary_key: 0 - is_unique: 0 - name: static - order: 6 - size: - - 0 - title: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: title - order: 5 - size: - - 0 - tl_options: - data_type: text - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: tl_options - order: 15 - size: - - 0 - type: - data_type: varchar - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: type - order: 4 - size: - - 16 - view_id: - data_type: integer - default_value: ~ - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: view_id - order: 12 - size: - - 0 - w: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: w - order: 8 - size: - - 0 - x: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: x - order: 9 - size: - - 0 - y: - data_type: smallint - default_value: 0 - is_nullable: 1 - is_primary_key: 0 - is_unique: 0 - name: y - order: 10 - size: - - 0 - indices: - - fields: - - dashboard_id - name: widget_idx_dashboard_id - options: [] - type: NORMAL - - fields: - - graph_id - name: widget_idx_graph_id - options: [] - type: NORMAL - - fields: - - view_id - name: widget_idx_view_id - options: [] - type: NORMAL - name: widget - options: [] - order: 65 - triggers: {} - views: {} -translator: - add_drop_table: 0 - filename: ~ - no_comments: 0 - parser_args: - sources: - - Alert - - AlertCache - - AlertColumn - - AlertSend - - Audit - - Authentication - - Calc - - Calcval - - Changed - - Current - - Curval - - CurvalField - - Dashboard - - Date - - Daterange - - Department - - DisplayField - - Enum - - Enumval - - Export - - File - - FileOption - - Fileval - - Filter - - FilteredValue - - Graph - - GraphColor - - Group - - Import - - ImportRow - - Instance - - InstanceGroup - - InstanceRag - - Intgr - - Layout - - LayoutDepend - - LayoutGroup - - Metric - - MetricGroup - - Oauthclient - - Oauthtoken - - Organisation - - Permission - - Person - - Rag - - Ragval - - Record - - Report - - ReportLayout - - Site - - Sort - - String - - Submission - - Team - - Title - - Topic - - User - - UserGraph - - UserGroup - - UserLastrecord - - UserPermission - - View - - ViewGroup - - ViewLayout - - ViewLimit - - Widget - parser_type: SQL::Translator::Parser::DBIx::Class - producer_args: - mysql_version: 5.7 - producer_type: SQL::Translator::Producer::YAML - show_warnings: 0 - trace: 0 - version: 1.63 diff --git a/src/frontend/components/button/lib/component.js b/src/frontend/components/button/lib/component.js index 0f863f407..e49a011f5 100644 --- a/src/frontend/components/button/lib/component.js +++ b/src/frontend/components/button/lib/component.js @@ -2,7 +2,6 @@ import { Component } from 'component' import { logging } from 'logging' import { MoreInfoButton } from './more-info-button' import { validateRequiredFields } from 'validation' -import CreateReportButtonComponent from './create-report-button' class ButtonComponent extends Component { constructor(element) { @@ -15,11 +14,8 @@ class ButtonComponent extends Component { initButton() { switch (true) { - case this.el.hasClass('btn-js-report'): - new CreateReportButtonComponent(this.element); - break; case this.el.hasClass('btn-js-more-info'): - new MoreInfoButton(this.el) + const moreInfoButton = new MoreInfoButton(this.el) break case this.el.hasClass('btn-js-delete'): this.initDelete() diff --git a/src/frontend/components/button/lib/create-report-button.js b/src/frontend/components/button/lib/create-report-button.js deleted file mode 100644 index 9ac290867..000000000 --- a/src/frontend/components/button/lib/create-report-button.js +++ /dev/null @@ -1,108 +0,0 @@ -//TODO: refactor this into smaller components -import { Component } from "component"; -import { validateRequiredFields } from "validation"; - -class CreateReportButtonComponent extends Component { - constructor(element) { - super(element); - this.el = $(element); - this.canSubmitRecordForm = false; - this.initSubmitReport(); - } - - initSubmitReport() { - this.el.on('click', (ev) => { this.submitReport(ev) }); - this.setupCheckboxes(); - this.setupHiddenField(); - } - - setupCheckboxes() { - const $fieldset = $(".fieldset--report"); - const $checkboxes = $fieldset.find("input[type=checkbox]"); - const $hidden = $('input#checkboxes'); - - $checkboxes.on("change", (ev) => { - const { target } = ev; - const $target = $(ev.target); - - if (target.checked) { - $(".alert__no__select").hide(); - } - - if (target.checked) { - if ($hidden && !$hidden.val()) { - $hidden.val($target.attr('id')); - } else if ($hidden && $hidden.val() && !($hidden.val().includes($target.attr('id')))) { - $hidden.val($hidden.val() + ',' + $target.attr('id')); - } else { - throw new Error('No hidden field found'); - } - } else if ($hidden && $hidden.val() && $hidden.val().includes($target.attr('id'))) { - const id = $target.attr('id'); - const rx = new RegExp(id + ',?'); - $hidden.val($hidden.val().replace(rx, '')); - } else { - throw new Error('No hidden field found'); - } - }); - } - - setupHiddenField() { - const $fieldset = $(".fieldset--report"); - const $checkboxes = $fieldset.find("input[type=checkbox]"); - const $hidden = $('input#checkboxes'); - - $checkboxes.each(function () { - const $this = $(this) - if ($this.is(":checked") || this.checked) { - if ($hidden && !$hidden.val()) { - $hidden.val($(this).attr('id')); - } else if ($hidden && $hidden.val()) { - $hidden.val($hidden.val() + ',' + $(this).attr('id')); - } else { - throw new Error('No hidden field found'); - } - } - }); - } - - checkForAtLeastOneValue($fieldset) { - const fields = $fieldset.find("input"); - - let result = false; - - fields.each(function () { - const $this = $(this) - if ($this.is(":checked") || this.checked) { - result = true; - } - }); - - return result; - } - - submitReport(ev) { - const $button = $(ev.target).closest('button'); - const $form = $button.closest("form"); - const $fieldset = $(".fieldset--report"); - const checked = this.checkForAtLeastOneValue($fieldset); - - if (!this.canSubmitRecordForm) { - ev.preventDefault(); - - const isValid = validateRequiredFields($form) && checked; - - if (isValid) { - this.submit($form); - } else if (!checked) { - $(".alert__no__select").show(); - } - } - } - - submit($form) { - $form.trigger("submit"); - } -} - -export default CreateReportButtonComponent; diff --git a/src/frontend/js/site.js b/src/frontend/js/site.js index 7136aef12..a11bd9757 100644 --- a/src/frontend/js/site.js +++ b/src/frontend/js/site.js @@ -36,8 +36,8 @@ import TippyComponent from 'components/timeline/tippy' import TreeComponent from 'components/form-group/tree' import UserModalComponent from 'components/modal/modals/user' import ValueLookupComponent from 'components/form-group/value-lookup' -import MarkdownComponent from "components/markdown" -import ButtonComponent from "components/button" +import MarkdownComponent from "../components/markdown" +import ButtonComponent from "../components/button" // Register them registerComponent(AddTableModalComponent) diff --git a/views/fields/checkbox_list.tt b/views/fields/checkbox_list.tt index 00bc92aeb..f93789d0a 100644 --- a/views/fields/checkbox_list.tt +++ b/views/fields/checkbox_list.tt @@ -1,18 +1,7 @@ -[% - - fieldset_extra_classes = "fieldset"; - IF fieldset_required; - fieldset_extra_classes = fieldset_extra_classes _ " fieldset--required"; - END; - IF fieldset_classes; - fieldset_extra_classes = fieldset_extra_classes _ " " _ fieldset_classes; - END; - -%] [% IF ! hide_group %]
[% END %] -
+
[% INCLUDE fields/sub/label_fieldset.tt; %]
    diff --git a/views/navigation/table_header_tab_menu.tt b/views/navigation/table_header_tab_menu.tt index 4267cbced..abf0df1a9 100644 --- a/views/navigation/table_header_tab_menu.tt +++ b/views/navigation/table_header_tab_menu.tt @@ -13,10 +13,5 @@ Edit table [% END; %] - [% IF user.permission.superadmin OR layout.user_can("layout"); %] -
  • - Reports -
  • - [% END; %]
diff --git a/views/report.tt b/views/report.tt deleted file mode 100644 index b7da7166c..000000000 --- a/views/report.tt +++ /dev/null @@ -1,175 +0,0 @@ -[% IF viewtype == 'table'; - - table_dom = "t"; - table_show_all_records = "true"; - - table_caption = "Reports"; - table_width = 85; - - table_columns = [{ - name = "Name", - orderable = 0, - }, { - name = "Actions", - orderable = 0 - }]; - - table_buttons = []; - - rows = []; - - FOREACH report IN reports; - data = { - fields = [{ - type = "string", - label = report.name - }] - }; - IF user.permission.superadmin; - data.fields.push({ - type = "link", - label = "Edit", - link = "report/edit" _ report.id - }); - END; #if - rows.push(data); - END; #foreach -%] - -
-
-
-

Reports

-
- -
-
-
-
- [% INCLUDE tables/basic_table.tt %] -
-
-
-
-
-
- -
-
- -[% ELSIF viewtype == 'edit' %] - -

We be editing

- -[% ELSIF viewtype == 'add' %] - -[% - - items = []; - - FOREACH field IN fields; - items.push({ - field_id = field.id, - name = field.name - id = field.id - }); - END; - - rowcount=0; - -%] -
- [% INCLUDE fields/hidden.tt name="submit" value="submit"; - INCLUDE fields/hidden.tt name="csrf_token" value=csrf_token; %] -
-
-
-

- Create Report -

-
- -
-
-
- [% - INCLUDE fields/input.tt - id = "report_name" - name = "report_name" - value = "" - label = "Report Name" - placeholder = "New Report Name" - input_class = "input--required" - is_required = 1; - INCLUDE fields/input.tt - id = "report_description" - name = "report_description" - value = "" - label = "Report Description" - placeholder = "New Report Description" - input_class = "input" - is_required = 0; - %] - - [% - INCLUDE fields/checkbox_list.tt - label = "Select fields to add" - fieldset_required = 1 - fieldset_classes = "fieldset--report" - id = "report_fields"; - INCLUDE fields/hidden.tt - name = "checkbox_fields" - value = "" - id = "checkboxes"; - %] -
-
-
-
-
- -
- -
-
- -[% ELSE %] - -

We be doing something else

- -[% END; %]