geoblacklight_admin 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.editorconfig +18 -0
- data/.gitignore +75 -0
- data/.standard.yml +4 -0
- data/Gemfile +59 -0
- data/LICENSE +21 -0
- data/README.md +84 -0
- data/Rakefile +72 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/aerial_photo.jpg +0 -0
- data/app/assets/images/archive-solid.svg +1 -0
- data/app/assets/images/bookmark-regular.svg +1 -0
- data/app/assets/images/bookmark-solid.svg +1 -0
- data/app/assets/images/btaa-logo.jpg +0 -0
- data/app/assets/images/cloud-download-alt-solid.svg +1 -0
- data/app/assets/images/file-import-solid.svg +1 -0
- data/app/assets/images/trash-alt-solid.svg +1 -0
- data/app/assets/javascripts/geoblacklight_admin/chosen.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/date_range_picker.js +173 -0
- data/app/assets/javascripts/geoblacklight_admin/datepicker.js +22 -0
- data/app/assets/javascripts/geoblacklight_admin/elements.js +38 -0
- data/app/assets/javascripts/geoblacklight_admin/exports.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/fields.js +11 -0
- data/app/assets/javascripts/geoblacklight_admin/geoblacklight_admin.js +2 -0
- data/app/assets/javascripts/geoblacklight_admin/inputmask.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/locale.js +5 -0
- data/app/assets/javascripts/geoblacklight_admin/sortable.js +2544 -0
- data/app/assets/javascripts/geoblacklight_admin/tooltips.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/truncate.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin.js +40 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +47 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_autocomplete.scss +32 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_blazer.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_code.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_datepicker.scss +477 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_elements.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +28 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_icons.scss +15 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +9 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_tables.scss +4 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_toasts.scss +7 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_visibility.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/settings/_variables.scss +1 -0
- data/app/channels/export_channel.rb +12 -0
- data/app/controllers/admin/admin_controller.rb +16 -0
- data/app/controllers/admin/advanced_search_controller.rb +365 -0
- data/app/controllers/admin/api_controller.rb +386 -0
- data/app/controllers/admin/bookmarks_controller.rb +68 -0
- data/app/controllers/admin/bulk_actions_controller.rb +94 -0
- data/app/controllers/admin/concerns/.keep +0 -0
- data/app/controllers/admin/concerns/upload_util.rb +8 -0
- data/app/controllers/admin/document_accesses_controller.rb +125 -0
- data/app/controllers/admin/document_assets_controller.rb +198 -0
- data/app/controllers/admin/document_downloads_controller.rb +127 -0
- data/app/controllers/admin/documents_controller.rb +219 -0
- data/app/controllers/admin/elements_controller.rb +81 -0
- data/app/controllers/admin/form_elements_controller.rb +81 -0
- data/app/controllers/admin/ids_controller.rb +379 -0
- data/app/controllers/admin/import_documents_controller.rb +18 -0
- data/app/controllers/admin/imports_controller.rb +105 -0
- data/app/controllers/admin/mappings_controller.rb +95 -0
- data/app/controllers/admin/notifications_controller.rb +51 -0
- data/app/controllers/admin/search_controller.rb +10 -0
- data/app/controllers/admin/users_controller.rb +10 -0
- data/app/helpers/bulk_actions_helper.rb +9 -0
- data/app/helpers/document_helper.rb +60 -0
- data/app/helpers/form_input_helper.rb +73 -0
- data/app/helpers/geoblacklight_admin_helper.rb +118 -0
- data/app/helpers/import_documents_helper.rb +5 -0
- data/app/helpers/mappings_helper.rb +27 -0
- data/app/indexers/document_indexer.rb +34 -0
- data/app/jobs/bulk_action_revert_document_job.rb +49 -0
- data/app/jobs/bulk_action_revert_job.rb +25 -0
- data/app/jobs/bulk_action_run_document_job.rb +42 -0
- data/app/jobs/bulk_action_run_job.rb +27 -0
- data/app/jobs/export_job.rb +72 -0
- data/app/jobs/export_json_job.rb +120 -0
- data/app/jobs/import_document_job.rb +25 -0
- data/app/jobs/import_run_job.rb +33 -0
- data/app/models/active_storage_attachment.rb +5 -0
- data/app/models/active_storage_blob.rb +5 -0
- data/app/models/api_search_builder.rb +12 -0
- data/app/models/application_record.rb +6 -0
- data/app/models/blacklight_api.rb +93 -0
- data/app/models/blacklight_api_facets.rb +15 -0
- data/app/models/blacklight_api_ids.rb +103 -0
- data/app/models/bookmark.rb +17 -0
- data/app/models/bulk_action.rb +88 -0
- data/app/models/bulk_action_document.rb +22 -0
- data/app/models/bulk_action_document_state_machine.rb +16 -0
- data/app/models/bulk_action_document_transition.rb +19 -0
- data/app/models/bulk_action_state_machine.rb +16 -0
- data/app/models/bulk_action_transition.rb +26 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/document/bbox_validator.rb +70 -0
- data/app/models/document/controlled_lists.rb +104 -0
- data/app/models/document/date_range_validator.rb +63 -0
- data/app/models/document/geom_validator.rb +117 -0
- data/app/models/document/reference.rb +107 -0
- data/app/models/document.rb +264 -0
- data/app/models/document_access.rb +35 -0
- data/app/models/document_download.rb +35 -0
- data/app/models/document_state_machine.rb +14 -0
- data/app/models/document_transition.rb +26 -0
- data/app/models/element.rb +90 -0
- data/app/models/form_control.rb +2 -0
- data/app/models/form_element.rb +19 -0
- data/app/models/form_feature.rb +2 -0
- data/app/models/form_group.rb +2 -0
- data/app/models/form_header.rb +2 -0
- data/app/models/geoblacklight_admin/field_mappings_btaa_aardvark.rb +379 -0
- data/app/models/geoblacklight_admin/field_mappings_gblv1.rb +344 -0
- data/app/models/geoblacklight_admin/iso_language_codes.rb +515 -0
- data/app/models/geoblacklight_admin/schema.rb +194 -0
- data/app/models/geoblacklight_admin.rb +3 -0
- data/app/models/import/csv_duplicates_validator.rb +36 -0
- data/app/models/import/csv_header_validator.rb +24 -0
- data/app/models/import.rb +186 -0
- data/app/models/import_btaa.rb +91 -0
- data/app/models/import_btaa_aardvark.rb +109 -0
- data/app/models/import_document.rb +34 -0
- data/app/models/import_document_state_machine.rb +12 -0
- data/app/models/import_document_transition.rb +19 -0
- data/app/models/import_gblv1.rb +92 -0
- data/app/models/import_state_machine.rb +16 -0
- data/app/models/import_transition.rb +26 -0
- data/app/models/mapping.rb +10 -0
- data/app/models/notification.rb +9 -0
- data/app/models/user.rb +26 -0
- data/app/notifications/export_notification.rb +30 -0
- data/app/services/export_csv_document_access_links_service.rb +47 -0
- data/app/services/export_csv_document_downloads_service.rb +47 -0
- data/app/services/export_csv_service.rb +44 -0
- data/app/services/export_json_service.rb +35 -0
- data/app/services/zip_file_generator.rb +56 -0
- data/app/views/admin/advanced_search/facets.json.jbuilder +80 -0
- data/app/views/admin/advanced_search/index.json.jbuilder +90 -0
- data/app/views/admin/api/_field.json.jbuilder +10 -0
- data/app/views/admin/api/fetch.json.jbuilder +86 -0
- data/app/views/admin/api/index.json.jbuilder +90 -0
- data/app/views/admin/bookmarks/_bookmark.json.jbuilder +4 -0
- data/app/views/admin/bookmarks/create.js.erb +7 -0
- data/app/views/admin/bookmarks/destroy.js.erb +7 -0
- data/app/views/admin/bookmarks/index.html.erb +21 -0
- data/app/views/admin/bookmarks/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/_bulk_action.json.jbuilder +4 -0
- data/app/views/admin/bulk_actions/_form.html.erb +17 -0
- data/app/views/admin/bulk_actions/edit.html.erb +6 -0
- data/app/views/admin/bulk_actions/index.html.erb +54 -0
- data/app/views/admin/bulk_actions/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/new.html.erb +5 -0
- data/app/views/admin/bulk_actions/show.html.erb +100 -0
- data/app/views/admin/bulk_actions/show.json.jbuilder +3 -0
- data/app/views/admin/devise/confirmations/new.html.erb +16 -0
- data/app/views/admin/devise/invitations/edit.html.erb +15 -0
- data/app/views/admin/devise/invitations/new.html.erb +15 -0
- data/app/views/admin/devise/mailer/invitation_instructions.html.erb +11 -0
- data/app/views/admin/devise/mailer/invitation_instructions.text.erb +11 -0
- data/app/views/admin/devise/passwords/edit.html.erb +26 -0
- data/app/views/admin/devise/passwords/new.html.erb +16 -0
- data/app/views/admin/devise/registrations/edit.html.erb +35 -0
- data/app/views/admin/devise/registrations/new.html.erb +30 -0
- data/app/views/admin/devise/sessions/new.html.erb +28 -0
- data/app/views/admin/devise/shared/_links.html.erb +27 -0
- data/app/views/admin/devise/unlocks/new.html.erb +16 -0
- data/app/views/admin/document_accesses/_document_access.json.jbuilder +4 -0
- data/app/views/admin/document_accesses/_form.html.erb +17 -0
- data/app/views/admin/document_accesses/destroy_all.html.erb +70 -0
- data/app/views/admin/document_accesses/edit.html.erb +5 -0
- data/app/views/admin/document_accesses/import.html.erb +70 -0
- data/app/views/admin/document_accesses/index.html.erb +74 -0
- data/app/views/admin/document_accesses/index.json.jbuilder +3 -0
- data/app/views/admin/document_accesses/new.html.erb +6 -0
- data/app/views/admin/document_accesses/show.html.erb +19 -0
- data/app/views/admin/document_accesses/show.json.jbuilder +3 -0
- data/app/views/admin/document_assets/display_attach_form.html.erb +44 -0
- data/app/views/admin/document_assets/index.html.erb +65 -0
- data/app/views/admin/document_downloads/_document_download.json.jbuilder +4 -0
- data/app/views/admin/document_downloads/_form.html.erb +15 -0
- data/app/views/admin/document_downloads/destroy_all.html.erb +70 -0
- data/app/views/admin/document_downloads/edit.html.erb +6 -0
- data/app/views/admin/document_downloads/import.html.erb +74 -0
- data/app/views/admin/document_downloads/index.html.erb +70 -0
- data/app/views/admin/document_downloads/index.json.jbuilder +3 -0
- data/app/views/admin/document_downloads/new.html.erb +5 -0
- data/app/views/admin/document_downloads/show.html.erb +24 -0
- data/app/views/admin/document_downloads/show.json.jbuilder +3 -0
- data/app/views/admin/documents/_document.html.erb +29 -0
- data/app/views/admin/documents/_document_bookmark.html.erb +17 -0
- data/app/views/admin/documents/_document_fields.html.erb +24 -0
- data/app/views/admin/documents/_form.html.erb +49 -0
- data/app/views/admin/documents/_form_control.html.erb +86 -0
- data/app/views/admin/documents/_form_group.html.erb +1 -0
- data/app/views/admin/documents/_form_header.html.erb +1 -0
- data/app/views/admin/documents/_form_nav.html.erb +21 -0
- data/app/views/admin/documents/_json_aardvark.jbuilder +47 -0
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +16 -0
- data/app/views/admin/documents/_json_gbl_v1.jbuilder +32 -0
- data/app/views/admin/documents/_result_facets.html.erb +35 -0
- data/app/views/admin/documents/_result_pagination.html.erb +21 -0
- data/app/views/admin/documents/_result_selected_options.html.erb +54 -0
- data/app/views/admin/documents/_result_selection_options.html.erb +10 -0
- data/app/views/admin/documents/_result_toggle.html.erb +13 -0
- data/app/views/admin/documents/edit.html.erb +7 -0
- data/app/views/admin/documents/features/_assets.html.erb +3 -0
- data/app/views/admin/documents/features/_institutional_access_links.html.erb +3 -0
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +27 -0
- data/app/views/admin/documents/fetch.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/index.html.erb +49 -0
- data/app/views/admin/documents/index.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/show.json_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_btaa_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_gbl_v1.jbuilder +3 -0
- data/app/views/admin/documents/versions.html.erb +110 -0
- data/app/views/admin/elements/_element.json.jbuilder +2 -0
- data/app/views/admin/elements/_form.html.erb +45 -0
- data/app/views/admin/elements/edit.html.erb +6 -0
- data/app/views/admin/elements/index.html.erb +68 -0
- data/app/views/admin/elements/index.json.jbuilder +1 -0
- data/app/views/admin/elements/new.html.erb +5 -0
- data/app/views/admin/elements/show.html.erb +121 -0
- data/app/views/admin/elements/show.json.jbuilder +1 -0
- data/app/views/admin/form_elements/_form.html.erb +46 -0
- data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
- data/app/views/admin/form_elements/edit.html.erb +6 -0
- data/app/views/admin/form_elements/index.html.erb +49 -0
- data/app/views/admin/form_elements/index.json.jbuilder +1 -0
- data/app/views/admin/form_elements/new.html.erb +5 -0
- data/app/views/admin/form_elements/show.html.erb +19 -0
- data/app/views/admin/form_elements/show.json.jbuilder +1 -0
- data/app/views/admin/ids/fetch.json.jbuilder +86 -0
- data/app/views/admin/ids/index.json.jbuilder +41 -0
- data/app/views/admin/import_documents/show.html.haml +20 -0
- data/app/views/admin/imports/_form.html.erb +27 -0
- data/app/views/admin/imports/_import.json.jbuilder +4 -0
- data/app/views/admin/imports/_show_failed_tab.html.erb +37 -0
- data/app/views/admin/imports/_show_success_tab.html.erb +31 -0
- data/app/views/admin/imports/edit.html.erb +8 -0
- data/app/views/admin/imports/index.html.erb +56 -0
- data/app/views/admin/imports/index.json.jbuilder +3 -0
- data/app/views/admin/imports/new.html.erb +7 -0
- data/app/views/admin/imports/show.html.erb +123 -0
- data/app/views/admin/imports/show.json.jbuilder +3 -0
- data/app/views/admin/layouts/application.html.erb +30 -0
- data/app/views/admin/layouts/blazer/application.html.erb +23 -0
- data/app/views/admin/layouts/mailer.html.erb +13 -0
- data/app/views/admin/layouts/mailer.text.erb +1 -0
- data/app/views/admin/mappings/_form.html.erb +17 -0
- data/app/views/admin/mappings/_mapping.json.jbuilder +4 -0
- data/app/views/admin/mappings/edit.html.erb +6 -0
- data/app/views/admin/mappings/index.html.erb +37 -0
- data/app/views/admin/mappings/index.json.jbuilder +3 -0
- data/app/views/admin/mappings/new.html.erb +5 -0
- data/app/views/admin/mappings/show.html.erb +27 -0
- data/app/views/admin/mappings/show.json.jbuilder +3 -0
- data/app/views/admin/notifications/_notification.html.haml +31 -0
- data/app/views/admin/notifications/index.html.erb +54 -0
- data/app/views/admin/notifications/update.js.erb +7 -0
- data/app/views/admin/search/index.html.erb +38 -0
- data/app/views/admin/shared/_flash_messages.html.erb +5 -0
- data/app/views/admin/shared/_footer.html.erb +56 -0
- data/app/views/admin/shared/_js_behaviors.html.erb +147 -0
- data/app/views/admin/shared/_navbar.html.erb +78 -0
- data/app/views/admin/shared/_navbar_blazer.html.erb +42 -0
- data/app/views/admin/shared/_schema_timestamp.html.erb +16 -0
- data/app/views/admin/shared/_toast.html.erb +13 -0
- data/app/views/admin/users/index.html.erb +21 -0
- data/config/authorities/formats.yml +25 -0
- data/config/authorities/languages.yml +50 -0
- data/config/authorities/resource_type.yml +82 -0
- data/config/blazer.yml +79 -0
- data/config/gbl_v1_schema.json +118 -0
- data/config/geomg_aardvark_schema.json +211 -0
- data/config/geomg_schema.json +123 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/devise_invitable.en.yml +31 -0
- data/config/locales/documents.en.yml +189 -0
- data/config/locales/en.yml +51 -0
- data/config/locales/geoblacklight.en.yml +178 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +162 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin.rb +399 -0
- data/db/seeds.rb +26 -0
- data/db/seeds_elements.csv +56 -0
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_form_elements.csv +71 -0
- data/db/seeds_form_elements.numbers +0 -0
- data/db/structure.sql +816 -0
- data/geoblacklight_admin.gemspec +67 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +336 -0
- data/lib/generators/geoblacklight_admin/example_docs_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/helpers_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/install_generator.rb +60 -0
- data/lib/generators/geoblacklight_admin/jobs_generator.rb +21 -0
- data/lib/generators/geoblacklight_admin/models_generator.rb +23 -0
- data/lib/generators/geoblacklight_admin/templates/.env.development.example +28 -0
- data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +7 -0
- data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +30 -0
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +18 -0
- data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +211 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +25 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +31 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +158 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/statesman.rb +7 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/consumer.js +6 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/export_channel.js +30 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/index.js +5 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/application_controller.js +17 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/document_controller.js +26 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/index.js +10 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +310 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/packs/application.js +23 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/src/js/admin/qa_autocomplete.js +1134 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +32 -0
- data/lib/generators/geoblacklight_admin/templates/solr/README-geoblacklight-solr-development.txt +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/_rest_managed.json +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/admin-extra.html +31 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/core.properties +5 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/elevate.xml +36 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/protwords.txt +21 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +229 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/scripts.conf +24 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/solrconfig.xml +266 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/spellings.txt +2 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords_en.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/synonyms.txt +43 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example.xsl +132 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_atom.xsl +67 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_rss.xsl +66 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/luke.xsl +337 -0
- data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
- data/lib/generators/geoblacklight_admin/views_generator.rb +19 -0
- data/lib/geoblacklight_admin/engine.rb +20 -0
- data/lib/geoblacklight_admin/version.rb +5 -0
- data/lib/geoblacklight_admin.rb +7 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/geoblacklight_admin.rake +209 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +35 -0
- data/template.rb +16 -0
- metadata +1037 -0
data/db/structure.sql
ADDED
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
SET statement_timeout = 0;
|
|
2
|
+
SET lock_timeout = 0;
|
|
3
|
+
SET idle_in_transaction_session_timeout = 0;
|
|
4
|
+
SET client_encoding = 'UTF8';
|
|
5
|
+
SET standard_conforming_strings = on;
|
|
6
|
+
SELECT pg_catalog.set_config('search_path', '', false);
|
|
7
|
+
SET check_function_bodies = false;
|
|
8
|
+
SET xmloption = content;
|
|
9
|
+
SET client_min_messages = warning;
|
|
10
|
+
SET row_security = off;
|
|
11
|
+
|
|
12
|
+
--
|
|
13
|
+
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
|
|
14
|
+
--
|
|
15
|
+
|
|
16
|
+
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
--
|
|
20
|
+
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: -
|
|
21
|
+
--
|
|
22
|
+
|
|
23
|
+
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
--
|
|
27
|
+
-- Name: kithe_models_friendlier_id_gen(bigint, bigint); Type: FUNCTION; Schema: public; Owner: -
|
|
28
|
+
--
|
|
29
|
+
|
|
30
|
+
CREATE FUNCTION public.kithe_models_friendlier_id_gen(min_value bigint, max_value bigint) RETURNS text
|
|
31
|
+
LANGUAGE plpgsql
|
|
32
|
+
AS $$
|
|
33
|
+
DECLARE
|
|
34
|
+
new_id_int bigint;
|
|
35
|
+
new_id_str character varying := '';
|
|
36
|
+
done bool;
|
|
37
|
+
tries integer;
|
|
38
|
+
alphabet char[] := ARRAY['0','1','2','3','4','5','6','7','8','9',
|
|
39
|
+
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
|
40
|
+
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
|
|
41
|
+
alphabet_length integer := array_length(alphabet, 1);
|
|
42
|
+
|
|
43
|
+
BEGIN
|
|
44
|
+
done := false;
|
|
45
|
+
tries := 0;
|
|
46
|
+
WHILE (NOT done) LOOP
|
|
47
|
+
tries := tries + 1;
|
|
48
|
+
IF (tries > 3) THEN
|
|
49
|
+
RAISE 'Could not find non-conflicting friendlier_id in 3 tries';
|
|
50
|
+
END IF;
|
|
51
|
+
|
|
52
|
+
new_id_int := trunc(random() * (max_value - min_value) + min_value);
|
|
53
|
+
|
|
54
|
+
-- convert bigint to a Base-36 alphanumeric string
|
|
55
|
+
-- see https://web.archive.org/web/20130420084605/http://www.jamiebegin.com/base36-conversion-in-postgresql/
|
|
56
|
+
-- https://gist.github.com/btbytes/7159902
|
|
57
|
+
WHILE new_id_int != 0 LOOP
|
|
58
|
+
new_id_str := alphabet[(new_id_int % alphabet_length)+1] || new_id_str;
|
|
59
|
+
new_id_int := new_id_int / alphabet_length;
|
|
60
|
+
END LOOP;
|
|
61
|
+
|
|
62
|
+
done := NOT exists(SELECT 1 FROM kithe_models WHERE friendlier_id=new_id_str);
|
|
63
|
+
END LOOP;
|
|
64
|
+
RETURN new_id_str;
|
|
65
|
+
END;
|
|
66
|
+
$$;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
SET default_tablespace = '';
|
|
70
|
+
|
|
71
|
+
SET default_table_access_method = heap;
|
|
72
|
+
|
|
73
|
+
--
|
|
74
|
+
-- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: -
|
|
75
|
+
--
|
|
76
|
+
|
|
77
|
+
CREATE TABLE public.active_storage_attachments (
|
|
78
|
+
id bigint NOT NULL,
|
|
79
|
+
name character varying NOT NULL,
|
|
80
|
+
record_type character varying NOT NULL,
|
|
81
|
+
record_id bigint NOT NULL,
|
|
82
|
+
blob_id bigint NOT NULL,
|
|
83
|
+
created_at timestamp without time zone NOT NULL
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
--
|
|
88
|
+
-- Name: active_storage_attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
89
|
+
--
|
|
90
|
+
|
|
91
|
+
CREATE SEQUENCE public.active_storage_attachments_id_seq
|
|
92
|
+
START WITH 1
|
|
93
|
+
INCREMENT BY 1
|
|
94
|
+
NO MINVALUE
|
|
95
|
+
NO MAXVALUE
|
|
96
|
+
CACHE 1;
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
--
|
|
100
|
+
-- Name: active_storage_attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
101
|
+
--
|
|
102
|
+
|
|
103
|
+
ALTER SEQUENCE public.active_storage_attachments_id_seq OWNED BY public.active_storage_attachments.id;
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
--
|
|
107
|
+
-- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: -
|
|
108
|
+
--
|
|
109
|
+
|
|
110
|
+
CREATE TABLE public.active_storage_blobs (
|
|
111
|
+
id bigint NOT NULL,
|
|
112
|
+
key character varying NOT NULL,
|
|
113
|
+
filename character varying NOT NULL,
|
|
114
|
+
content_type character varying,
|
|
115
|
+
metadata text,
|
|
116
|
+
byte_size bigint NOT NULL,
|
|
117
|
+
checksum character varying NOT NULL,
|
|
118
|
+
created_at timestamp without time zone NOT NULL
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
--
|
|
123
|
+
-- Name: active_storage_blobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
124
|
+
--
|
|
125
|
+
|
|
126
|
+
CREATE SEQUENCE public.active_storage_blobs_id_seq
|
|
127
|
+
START WITH 1
|
|
128
|
+
INCREMENT BY 1
|
|
129
|
+
NO MINVALUE
|
|
130
|
+
NO MAXVALUE
|
|
131
|
+
CACHE 1;
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
--
|
|
135
|
+
-- Name: active_storage_blobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
136
|
+
--
|
|
137
|
+
|
|
138
|
+
ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id;
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
--
|
|
142
|
+
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
|
|
143
|
+
--
|
|
144
|
+
|
|
145
|
+
CREATE TABLE public.ar_internal_metadata (
|
|
146
|
+
key character varying NOT NULL,
|
|
147
|
+
value character varying,
|
|
148
|
+
created_at timestamp(6) without time zone NOT NULL,
|
|
149
|
+
updated_at timestamp(6) without time zone NOT NULL
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
--
|
|
154
|
+
-- Name: import_transitions; Type: TABLE; Schema: public; Owner: -
|
|
155
|
+
--
|
|
156
|
+
|
|
157
|
+
CREATE TABLE public.import_transitions (
|
|
158
|
+
id bigint NOT NULL,
|
|
159
|
+
to_state character varying NOT NULL,
|
|
160
|
+
metadata text DEFAULT '{}'::text,
|
|
161
|
+
sort_key integer NOT NULL,
|
|
162
|
+
import_id integer NOT NULL,
|
|
163
|
+
most_recent boolean NOT NULL,
|
|
164
|
+
created_at timestamp(6) without time zone NOT NULL,
|
|
165
|
+
updated_at timestamp(6) without time zone NOT NULL
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
--
|
|
170
|
+
-- Name: import_transitions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
171
|
+
--
|
|
172
|
+
|
|
173
|
+
CREATE SEQUENCE public.import_transitions_id_seq
|
|
174
|
+
START WITH 1
|
|
175
|
+
INCREMENT BY 1
|
|
176
|
+
NO MINVALUE
|
|
177
|
+
NO MAXVALUE
|
|
178
|
+
CACHE 1;
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
--
|
|
182
|
+
-- Name: import_transitions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
183
|
+
--
|
|
184
|
+
|
|
185
|
+
ALTER SEQUENCE public.import_transitions_id_seq OWNED BY public.import_transitions.id;
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
--
|
|
189
|
+
-- Name: imports; Type: TABLE; Schema: public; Owner: -
|
|
190
|
+
--
|
|
191
|
+
|
|
192
|
+
CREATE TABLE public.imports (
|
|
193
|
+
id bigint NOT NULL,
|
|
194
|
+
name character varying NOT NULL,
|
|
195
|
+
source character varying,
|
|
196
|
+
description text,
|
|
197
|
+
filename character varying,
|
|
198
|
+
row_count integer,
|
|
199
|
+
headers text[] DEFAULT '{}'::text[],
|
|
200
|
+
encoding character varying,
|
|
201
|
+
content_type character varying,
|
|
202
|
+
extension character varying,
|
|
203
|
+
validity boolean DEFAULT false NOT NULL,
|
|
204
|
+
validation_result text,
|
|
205
|
+
created_at timestamp(6) without time zone NOT NULL,
|
|
206
|
+
updated_at timestamp(6) without time zone NOT NULL,
|
|
207
|
+
type character varying,
|
|
208
|
+
import_log json DEFAULT '{}'::json
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
--
|
|
213
|
+
-- Name: imports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
214
|
+
--
|
|
215
|
+
|
|
216
|
+
CREATE SEQUENCE public.imports_id_seq
|
|
217
|
+
START WITH 1
|
|
218
|
+
INCREMENT BY 1
|
|
219
|
+
NO MINVALUE
|
|
220
|
+
NO MAXVALUE
|
|
221
|
+
CACHE 1;
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
--
|
|
225
|
+
-- Name: imports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
226
|
+
--
|
|
227
|
+
|
|
228
|
+
ALTER SEQUENCE public.imports_id_seq OWNED BY public.imports.id;
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
--
|
|
232
|
+
-- Name: kithe_derivatives; Type: TABLE; Schema: public; Owner: -
|
|
233
|
+
--
|
|
234
|
+
|
|
235
|
+
CREATE TABLE public.kithe_derivatives (
|
|
236
|
+
id bigint NOT NULL,
|
|
237
|
+
key character varying NOT NULL,
|
|
238
|
+
file_data jsonb,
|
|
239
|
+
asset_id uuid NOT NULL,
|
|
240
|
+
created_at timestamp without time zone NOT NULL,
|
|
241
|
+
updated_at timestamp without time zone NOT NULL
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
--
|
|
246
|
+
-- Name: kithe_derivatives_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
247
|
+
--
|
|
248
|
+
|
|
249
|
+
CREATE SEQUENCE public.kithe_derivatives_id_seq
|
|
250
|
+
START WITH 1
|
|
251
|
+
INCREMENT BY 1
|
|
252
|
+
NO MINVALUE
|
|
253
|
+
NO MAXVALUE
|
|
254
|
+
CACHE 1;
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
--
|
|
258
|
+
-- Name: kithe_derivatives_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
259
|
+
--
|
|
260
|
+
|
|
261
|
+
ALTER SEQUENCE public.kithe_derivatives_id_seq OWNED BY public.kithe_derivatives.id;
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
--
|
|
265
|
+
-- Name: kithe_model_contains; Type: TABLE; Schema: public; Owner: -
|
|
266
|
+
--
|
|
267
|
+
|
|
268
|
+
CREATE TABLE public.kithe_model_contains (
|
|
269
|
+
containee_id uuid,
|
|
270
|
+
container_id uuid
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
--
|
|
275
|
+
-- Name: kithe_models; Type: TABLE; Schema: public; Owner: -
|
|
276
|
+
--
|
|
277
|
+
|
|
278
|
+
CREATE TABLE public.kithe_models (
|
|
279
|
+
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
|
|
280
|
+
title character varying NOT NULL,
|
|
281
|
+
type character varying NOT NULL,
|
|
282
|
+
"position" integer,
|
|
283
|
+
json_attributes jsonb,
|
|
284
|
+
created_at timestamp without time zone NOT NULL,
|
|
285
|
+
updated_at timestamp without time zone NOT NULL,
|
|
286
|
+
parent_id uuid,
|
|
287
|
+
friendlier_id character varying DEFAULT public.kithe_models_friendlier_id_gen('2821109907456'::bigint, '101559956668415'::bigint) NOT NULL,
|
|
288
|
+
file_data jsonb,
|
|
289
|
+
representative_id uuid,
|
|
290
|
+
leaf_representative_id uuid,
|
|
291
|
+
kithe_model_type integer NOT NULL,
|
|
292
|
+
import_id bigint
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
--
|
|
297
|
+
-- Name: mappings; Type: TABLE; Schema: public; Owner: -
|
|
298
|
+
--
|
|
299
|
+
|
|
300
|
+
CREATE TABLE public.mappings (
|
|
301
|
+
id bigint NOT NULL,
|
|
302
|
+
source_header character varying,
|
|
303
|
+
destination_field character varying,
|
|
304
|
+
delimited boolean,
|
|
305
|
+
transformation_method character varying,
|
|
306
|
+
import_id bigint NOT NULL,
|
|
307
|
+
created_at timestamp(6) without time zone NOT NULL,
|
|
308
|
+
updated_at timestamp(6) without time zone NOT NULL
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
--
|
|
313
|
+
-- Name: mappings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
314
|
+
--
|
|
315
|
+
|
|
316
|
+
CREATE SEQUENCE public.mappings_id_seq
|
|
317
|
+
START WITH 1
|
|
318
|
+
INCREMENT BY 1
|
|
319
|
+
NO MINVALUE
|
|
320
|
+
NO MAXVALUE
|
|
321
|
+
CACHE 1;
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
--
|
|
325
|
+
-- Name: mappings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
326
|
+
--
|
|
327
|
+
|
|
328
|
+
ALTER SEQUENCE public.mappings_id_seq OWNED BY public.mappings.id;
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
--
|
|
332
|
+
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
|
|
333
|
+
--
|
|
334
|
+
|
|
335
|
+
CREATE TABLE public.schema_migrations (
|
|
336
|
+
version character varying NOT NULL
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
--
|
|
341
|
+
-- Name: users; Type: TABLE; Schema: public; Owner: -
|
|
342
|
+
--
|
|
343
|
+
|
|
344
|
+
CREATE TABLE public.users (
|
|
345
|
+
id bigint NOT NULL,
|
|
346
|
+
email character varying DEFAULT ''::character varying NOT NULL,
|
|
347
|
+
encrypted_password character varying DEFAULT ''::character varying NOT NULL,
|
|
348
|
+
reset_password_token character varying,
|
|
349
|
+
reset_password_sent_at timestamp without time zone,
|
|
350
|
+
remember_created_at timestamp without time zone,
|
|
351
|
+
created_at timestamp(6) without time zone NOT NULL,
|
|
352
|
+
updated_at timestamp(6) without time zone NOT NULL,
|
|
353
|
+
invitation_token character varying,
|
|
354
|
+
invitation_created_at timestamp without time zone,
|
|
355
|
+
invitation_sent_at timestamp without time zone,
|
|
356
|
+
invitation_accepted_at timestamp without time zone,
|
|
357
|
+
invitation_limit integer,
|
|
358
|
+
invited_by_type character varying,
|
|
359
|
+
invited_by_id bigint,
|
|
360
|
+
invitations_count integer DEFAULT 0
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
--
|
|
365
|
+
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
366
|
+
--
|
|
367
|
+
|
|
368
|
+
CREATE SEQUENCE public.users_id_seq
|
|
369
|
+
START WITH 1
|
|
370
|
+
INCREMENT BY 1
|
|
371
|
+
NO MINVALUE
|
|
372
|
+
NO MAXVALUE
|
|
373
|
+
CACHE 1;
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
--
|
|
377
|
+
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
378
|
+
--
|
|
379
|
+
|
|
380
|
+
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
--
|
|
384
|
+
-- Name: versions; Type: TABLE; Schema: public; Owner: -
|
|
385
|
+
--
|
|
386
|
+
|
|
387
|
+
CREATE TABLE public.versions (
|
|
388
|
+
id bigint NOT NULL,
|
|
389
|
+
item_type character varying NOT NULL,
|
|
390
|
+
item_id uuid NOT NULL,
|
|
391
|
+
event character varying NOT NULL,
|
|
392
|
+
whodunnit character varying,
|
|
393
|
+
object text,
|
|
394
|
+
created_at timestamp without time zone,
|
|
395
|
+
object_changes text
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
--
|
|
400
|
+
-- Name: versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
401
|
+
--
|
|
402
|
+
|
|
403
|
+
CREATE SEQUENCE public.versions_id_seq
|
|
404
|
+
START WITH 1
|
|
405
|
+
INCREMENT BY 1
|
|
406
|
+
NO MINVALUE
|
|
407
|
+
NO MAXVALUE
|
|
408
|
+
CACHE 1;
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
--
|
|
412
|
+
-- Name: versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
413
|
+
--
|
|
414
|
+
|
|
415
|
+
ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id;
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
--
|
|
419
|
+
-- Name: active_storage_attachments id; Type: DEFAULT; Schema: public; Owner: -
|
|
420
|
+
--
|
|
421
|
+
|
|
422
|
+
ALTER TABLE ONLY public.active_storage_attachments ALTER COLUMN id SET DEFAULT nextval('public.active_storage_attachments_id_seq'::regclass);
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
--
|
|
426
|
+
-- Name: active_storage_blobs id; Type: DEFAULT; Schema: public; Owner: -
|
|
427
|
+
--
|
|
428
|
+
|
|
429
|
+
ALTER TABLE ONLY public.active_storage_blobs ALTER COLUMN id SET DEFAULT nextval('public.active_storage_blobs_id_seq'::regclass);
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
--
|
|
433
|
+
-- Name: import_transitions id; Type: DEFAULT; Schema: public; Owner: -
|
|
434
|
+
--
|
|
435
|
+
|
|
436
|
+
ALTER TABLE ONLY public.import_transitions ALTER COLUMN id SET DEFAULT nextval('public.import_transitions_id_seq'::regclass);
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
--
|
|
440
|
+
-- Name: imports id; Type: DEFAULT; Schema: public; Owner: -
|
|
441
|
+
--
|
|
442
|
+
|
|
443
|
+
ALTER TABLE ONLY public.imports ALTER COLUMN id SET DEFAULT nextval('public.imports_id_seq'::regclass);
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
--
|
|
447
|
+
-- Name: kithe_derivatives id; Type: DEFAULT; Schema: public; Owner: -
|
|
448
|
+
--
|
|
449
|
+
|
|
450
|
+
ALTER TABLE ONLY public.kithe_derivatives ALTER COLUMN id SET DEFAULT nextval('public.kithe_derivatives_id_seq'::regclass);
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
--
|
|
454
|
+
-- Name: mappings id; Type: DEFAULT; Schema: public; Owner: -
|
|
455
|
+
--
|
|
456
|
+
|
|
457
|
+
ALTER TABLE ONLY public.mappings ALTER COLUMN id SET DEFAULT nextval('public.mappings_id_seq'::regclass);
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
--
|
|
461
|
+
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
|
|
462
|
+
--
|
|
463
|
+
|
|
464
|
+
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
--
|
|
468
|
+
-- Name: versions id; Type: DEFAULT; Schema: public; Owner: -
|
|
469
|
+
--
|
|
470
|
+
|
|
471
|
+
ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass);
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
--
|
|
475
|
+
-- Name: active_storage_attachments active_storage_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
476
|
+
--
|
|
477
|
+
|
|
478
|
+
ALTER TABLE ONLY public.active_storage_attachments
|
|
479
|
+
ADD CONSTRAINT active_storage_attachments_pkey PRIMARY KEY (id);
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
--
|
|
483
|
+
-- Name: active_storage_blobs active_storage_blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
484
|
+
--
|
|
485
|
+
|
|
486
|
+
ALTER TABLE ONLY public.active_storage_blobs
|
|
487
|
+
ADD CONSTRAINT active_storage_blobs_pkey PRIMARY KEY (id);
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
--
|
|
491
|
+
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
492
|
+
--
|
|
493
|
+
|
|
494
|
+
ALTER TABLE ONLY public.ar_internal_metadata
|
|
495
|
+
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
--
|
|
499
|
+
-- Name: import_transitions import_transitions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
500
|
+
--
|
|
501
|
+
|
|
502
|
+
ALTER TABLE ONLY public.import_transitions
|
|
503
|
+
ADD CONSTRAINT import_transitions_pkey PRIMARY KEY (id);
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
--
|
|
507
|
+
-- Name: imports imports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
508
|
+
--
|
|
509
|
+
|
|
510
|
+
ALTER TABLE ONLY public.imports
|
|
511
|
+
ADD CONSTRAINT imports_pkey PRIMARY KEY (id);
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
--
|
|
515
|
+
-- Name: kithe_derivatives kithe_derivatives_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
516
|
+
--
|
|
517
|
+
|
|
518
|
+
ALTER TABLE ONLY public.kithe_derivatives
|
|
519
|
+
ADD CONSTRAINT kithe_derivatives_pkey PRIMARY KEY (id);
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
--
|
|
523
|
+
-- Name: kithe_models kithe_models_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
524
|
+
--
|
|
525
|
+
|
|
526
|
+
ALTER TABLE ONLY public.kithe_models
|
|
527
|
+
ADD CONSTRAINT kithe_models_pkey PRIMARY KEY (id);
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
--
|
|
531
|
+
-- Name: mappings mappings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
532
|
+
--
|
|
533
|
+
|
|
534
|
+
ALTER TABLE ONLY public.mappings
|
|
535
|
+
ADD CONSTRAINT mappings_pkey PRIMARY KEY (id);
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
--
|
|
539
|
+
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
540
|
+
--
|
|
541
|
+
|
|
542
|
+
ALTER TABLE ONLY public.schema_migrations
|
|
543
|
+
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
--
|
|
547
|
+
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
548
|
+
--
|
|
549
|
+
|
|
550
|
+
ALTER TABLE ONLY public.users
|
|
551
|
+
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
--
|
|
555
|
+
-- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
556
|
+
--
|
|
557
|
+
|
|
558
|
+
ALTER TABLE ONLY public.versions
|
|
559
|
+
ADD CONSTRAINT versions_pkey PRIMARY KEY (id);
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
--
|
|
563
|
+
-- Name: index_active_storage_attachments_on_blob_id; Type: INDEX; Schema: public; Owner: -
|
|
564
|
+
--
|
|
565
|
+
|
|
566
|
+
CREATE INDEX index_active_storage_attachments_on_blob_id ON public.active_storage_attachments USING btree (blob_id);
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
--
|
|
570
|
+
-- Name: index_active_storage_attachments_uniqueness; Type: INDEX; Schema: public; Owner: -
|
|
571
|
+
--
|
|
572
|
+
|
|
573
|
+
CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active_storage_attachments USING btree (record_type, record_id, name, blob_id);
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
--
|
|
577
|
+
-- Name: index_active_storage_blobs_on_key; Type: INDEX; Schema: public; Owner: -
|
|
578
|
+
--
|
|
579
|
+
|
|
580
|
+
CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key);
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
--
|
|
584
|
+
-- Name: index_import_transitions_parent_most_recent; Type: INDEX; Schema: public; Owner: -
|
|
585
|
+
--
|
|
586
|
+
|
|
587
|
+
CREATE UNIQUE INDEX index_import_transitions_parent_most_recent ON public.import_transitions USING btree (import_id, most_recent) WHERE most_recent;
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
--
|
|
591
|
+
-- Name: index_import_transitions_parent_sort; Type: INDEX; Schema: public; Owner: -
|
|
592
|
+
--
|
|
593
|
+
|
|
594
|
+
CREATE UNIQUE INDEX index_import_transitions_parent_sort ON public.import_transitions USING btree (import_id, sort_key);
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
--
|
|
598
|
+
-- Name: index_kithe_derivatives_on_asset_id; Type: INDEX; Schema: public; Owner: -
|
|
599
|
+
--
|
|
600
|
+
|
|
601
|
+
CREATE INDEX index_kithe_derivatives_on_asset_id ON public.kithe_derivatives USING btree (asset_id);
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
--
|
|
605
|
+
-- Name: index_kithe_derivatives_on_asset_id_and_key; Type: INDEX; Schema: public; Owner: -
|
|
606
|
+
--
|
|
607
|
+
|
|
608
|
+
CREATE UNIQUE INDEX index_kithe_derivatives_on_asset_id_and_key ON public.kithe_derivatives USING btree (asset_id, key);
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
--
|
|
612
|
+
-- Name: index_kithe_model_contains_on_containee_id; Type: INDEX; Schema: public; Owner: -
|
|
613
|
+
--
|
|
614
|
+
|
|
615
|
+
CREATE INDEX index_kithe_model_contains_on_containee_id ON public.kithe_model_contains USING btree (containee_id);
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
--
|
|
619
|
+
-- Name: index_kithe_model_contains_on_container_id; Type: INDEX; Schema: public; Owner: -
|
|
620
|
+
--
|
|
621
|
+
|
|
622
|
+
CREATE INDEX index_kithe_model_contains_on_container_id ON public.kithe_model_contains USING btree (container_id);
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
--
|
|
626
|
+
-- Name: index_kithe_models_on_friendlier_id; Type: INDEX; Schema: public; Owner: -
|
|
627
|
+
--
|
|
628
|
+
|
|
629
|
+
CREATE UNIQUE INDEX index_kithe_models_on_friendlier_id ON public.kithe_models USING btree (friendlier_id);
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
--
|
|
633
|
+
-- Name: index_kithe_models_on_import_id; Type: INDEX; Schema: public; Owner: -
|
|
634
|
+
--
|
|
635
|
+
|
|
636
|
+
CREATE INDEX index_kithe_models_on_import_id ON public.kithe_models USING btree (import_id);
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
--
|
|
640
|
+
-- Name: index_kithe_models_on_leaf_representative_id; Type: INDEX; Schema: public; Owner: -
|
|
641
|
+
--
|
|
642
|
+
|
|
643
|
+
CREATE INDEX index_kithe_models_on_leaf_representative_id ON public.kithe_models USING btree (leaf_representative_id);
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
--
|
|
647
|
+
-- Name: index_kithe_models_on_parent_id; Type: INDEX; Schema: public; Owner: -
|
|
648
|
+
--
|
|
649
|
+
|
|
650
|
+
CREATE INDEX index_kithe_models_on_parent_id ON public.kithe_models USING btree (parent_id);
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
--
|
|
654
|
+
-- Name: index_kithe_models_on_representative_id; Type: INDEX; Schema: public; Owner: -
|
|
655
|
+
--
|
|
656
|
+
|
|
657
|
+
CREATE INDEX index_kithe_models_on_representative_id ON public.kithe_models USING btree (representative_id);
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
--
|
|
661
|
+
-- Name: index_mappings_on_import_id; Type: INDEX; Schema: public; Owner: -
|
|
662
|
+
--
|
|
663
|
+
|
|
664
|
+
CREATE INDEX index_mappings_on_import_id ON public.mappings USING btree (import_id);
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
--
|
|
668
|
+
-- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -
|
|
669
|
+
--
|
|
670
|
+
|
|
671
|
+
CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
--
|
|
675
|
+
-- Name: index_users_on_invitation_token; Type: INDEX; Schema: public; Owner: -
|
|
676
|
+
--
|
|
677
|
+
|
|
678
|
+
CREATE UNIQUE INDEX index_users_on_invitation_token ON public.users USING btree (invitation_token);
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
--
|
|
682
|
+
-- Name: index_users_on_invitations_count; Type: INDEX; Schema: public; Owner: -
|
|
683
|
+
--
|
|
684
|
+
|
|
685
|
+
CREATE INDEX index_users_on_invitations_count ON public.users USING btree (invitations_count);
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
--
|
|
689
|
+
-- Name: index_users_on_invited_by_id; Type: INDEX; Schema: public; Owner: -
|
|
690
|
+
--
|
|
691
|
+
|
|
692
|
+
CREATE INDEX index_users_on_invited_by_id ON public.users USING btree (invited_by_id);
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
--
|
|
696
|
+
-- Name: index_users_on_invited_by_type_and_invited_by_id; Type: INDEX; Schema: public; Owner: -
|
|
697
|
+
--
|
|
698
|
+
|
|
699
|
+
CREATE INDEX index_users_on_invited_by_type_and_invited_by_id ON public.users USING btree (invited_by_type, invited_by_id);
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
--
|
|
703
|
+
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
|
|
704
|
+
--
|
|
705
|
+
|
|
706
|
+
CREATE UNIQUE INDEX index_users_on_reset_password_token ON public.users USING btree (reset_password_token);
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
--
|
|
710
|
+
-- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -
|
|
711
|
+
--
|
|
712
|
+
|
|
713
|
+
CREATE INDEX index_versions_on_item_type_and_item_id ON public.versions USING btree (item_type, item_id);
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
--
|
|
717
|
+
-- Name: kithe_model_contains fk_rails_091010187b; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
718
|
+
--
|
|
719
|
+
|
|
720
|
+
ALTER TABLE ONLY public.kithe_model_contains
|
|
721
|
+
ADD CONSTRAINT fk_rails_091010187b FOREIGN KEY (container_id) REFERENCES public.kithe_models(id);
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
--
|
|
725
|
+
-- Name: kithe_derivatives fk_rails_3dac8b4201; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
726
|
+
--
|
|
727
|
+
|
|
728
|
+
ALTER TABLE ONLY public.kithe_derivatives
|
|
729
|
+
ADD CONSTRAINT fk_rails_3dac8b4201 FOREIGN KEY (asset_id) REFERENCES public.kithe_models(id);
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
--
|
|
733
|
+
-- Name: kithe_models fk_rails_403cce5c0d; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
734
|
+
--
|
|
735
|
+
|
|
736
|
+
ALTER TABLE ONLY public.kithe_models
|
|
737
|
+
ADD CONSTRAINT fk_rails_403cce5c0d FOREIGN KEY (leaf_representative_id) REFERENCES public.kithe_models(id);
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
--
|
|
741
|
+
-- Name: kithe_model_contains fk_rails_490c1158f7; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
742
|
+
--
|
|
743
|
+
|
|
744
|
+
ALTER TABLE ONLY public.kithe_model_contains
|
|
745
|
+
ADD CONSTRAINT fk_rails_490c1158f7 FOREIGN KEY (containee_id) REFERENCES public.kithe_models(id);
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
--
|
|
749
|
+
-- Name: kithe_models fk_rails_90130a9780; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
750
|
+
--
|
|
751
|
+
|
|
752
|
+
ALTER TABLE ONLY public.kithe_models
|
|
753
|
+
ADD CONSTRAINT fk_rails_90130a9780 FOREIGN KEY (parent_id) REFERENCES public.kithe_models(id);
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
--
|
|
757
|
+
-- Name: kithe_models fk_rails_afa93b7b5d; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
758
|
+
--
|
|
759
|
+
|
|
760
|
+
ALTER TABLE ONLY public.kithe_models
|
|
761
|
+
ADD CONSTRAINT fk_rails_afa93b7b5d FOREIGN KEY (representative_id) REFERENCES public.kithe_models(id);
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
--
|
|
765
|
+
-- Name: active_storage_attachments fk_rails_c3b3935057; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
766
|
+
--
|
|
767
|
+
|
|
768
|
+
ALTER TABLE ONLY public.active_storage_attachments
|
|
769
|
+
ADD CONSTRAINT fk_rails_c3b3935057 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id);
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
--
|
|
773
|
+
-- Name: import_transitions fk_rails_e10d6cb765; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
774
|
+
--
|
|
775
|
+
|
|
776
|
+
ALTER TABLE ONLY public.import_transitions
|
|
777
|
+
ADD CONSTRAINT fk_rails_e10d6cb765 FOREIGN KEY (import_id) REFERENCES public.imports(id);
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
--
|
|
781
|
+
-- Name: mappings fk_rails_eff9d46a25; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
782
|
+
--
|
|
783
|
+
|
|
784
|
+
ALTER TABLE ONLY public.mappings
|
|
785
|
+
ADD CONSTRAINT fk_rails_eff9d46a25 FOREIGN KEY (import_id) REFERENCES public.imports(id);
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
--
|
|
789
|
+
-- PostgreSQL database dump complete
|
|
790
|
+
--
|
|
791
|
+
|
|
792
|
+
SET search_path TO "$user", public;
|
|
793
|
+
|
|
794
|
+
INSERT INTO "schema_migrations" (version) VALUES
|
|
795
|
+
('20200127213631'),
|
|
796
|
+
('20200127213632'),
|
|
797
|
+
('20200127213633'),
|
|
798
|
+
('20200127213634'),
|
|
799
|
+
('20200127213635'),
|
|
800
|
+
('20200127213636'),
|
|
801
|
+
('20200127213637'),
|
|
802
|
+
('20200127213638'),
|
|
803
|
+
('20200322214159'),
|
|
804
|
+
('20200326193145'),
|
|
805
|
+
('20200326212815'),
|
|
806
|
+
('20200428184517'),
|
|
807
|
+
('20200428194419'),
|
|
808
|
+
('20200429182712'),
|
|
809
|
+
('20200501143805'),
|
|
810
|
+
('20200501153955'),
|
|
811
|
+
('20200522141137'),
|
|
812
|
+
('20200522154119'),
|
|
813
|
+
('20200529173739'),
|
|
814
|
+
('20200626194058');
|
|
815
|
+
|
|
816
|
+
|