├── .github └── workflows │ └── docker.yml ├── .gitignore ├── Makefile ├── POSTGRES.md ├── README.md ├── mssql ├── adventureWorks2012 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── adventureWorks2014 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── adventureWorks2016 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── adventureWorks2017 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── adventureWorks2019 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── bikeStores │ ├── README.md │ ├── data.sql │ └── schema.sql ├── chinook │ ├── README.md │ ├── data.sql │ └── schema.sql ├── employeeCaseStudy │ ├── README.md │ ├── data.sql │ └── schema.sql ├── exo │ ├── README.md │ ├── data.sql │ └── schema.sql ├── gitlab │ ├── README.md │ ├── data.sql │ └── schema.sql ├── helpdesk │ ├── README.md │ ├── data.sql │ └── schema.sql ├── hr │ ├── README.md │ ├── data.sql │ └── schema.sql ├── katmai │ ├── README.md │ ├── data.sql │ └── schema.sql ├── learningSql │ ├── README.md │ ├── data.sql │ └── schema.sql ├── mastodon │ ├── README.md │ └── schema.sql ├── northwindPubs │ ├── README.md │ ├── data.sql │ └── schema.sql ├── opendota │ ├── README.md │ └── schema.sql ├── ruma │ ├── README.md │ └── schema.sql ├── shakespeare │ ├── README.md │ └── schema.sql ├── sonarqube │ ├── README.md │ └── schema.sql ├── sportsdb │ ├── README.md │ └── schema.sql ├── stackOverflow2020 │ ├── README.md │ └── schema.sql ├── standup-slack-bot │ ├── README.md │ └── schema.sql └── students │ ├── README.md │ └── schema.sql ├── mysql-v8 └── prisma-3089 │ └── schema.sql ├── mysql ├── README.md ├── allsquare │ ├── README.md │ ├── allsquare_sanitized.sql │ ├── datamodel.prisma │ └── schema.sql ├── b2evolution │ ├── README.md │ ├── data.sql │ └── schema.sql ├── barro-colorado │ ├── README.md │ ├── schema.png │ └── schema.sql ├── chinook │ ├── README.md │ ├── data.sql │ └── schema.sql ├── ciboard3pro │ ├── README.md │ └── schema.sql ├── collabtive │ ├── README.md │ ├── data.sql │ └── schema.sql ├── concrete5 │ ├── README.md │ └── schema.sql ├── contao │ ├── README.md │ └── schema.sql ├── coppermine │ ├── README.md │ ├── data.sql │ └── schema.sql ├── cubecart │ ├── README.md │ ├── data.sql │ └── schema.sql ├── dolibarr │ ├── README.md │ ├── data.sql │ └── schema.sql ├── dotclear │ ├── README.md │ ├── data.sql │ └── schema.sql ├── drupal │ ├── README.md │ └── schema.sql ├── e107 │ ├── README.md │ ├── data.sql │ └── schema.sql ├── elgg │ ├── README.md │ ├── data.sql │ └── schema.sql ├── employees │ ├── README.md │ └── schema.sql ├── empty │ ├── README.md │ └── schema.sql ├── exo │ ├── README.md │ ├── data.sql │ └── schema.sql ├── ezpublish │ ├── README.md │ └── ezpublish.sql ├── filerun │ ├── README.md │ └── schema.sql ├── fluxbb │ ├── README.md │ ├── data.sql │ └── schema.sql ├── formtools │ ├── README.md │ ├── data.sql │ └── schema.sql ├── frontaccounting │ ├── README.md │ ├── data.sql │ └── schema.sql ├── ghost │ ├── README.md │ └── schema.sql ├── gnuboard5 │ ├── README.md │ └── schema.sql ├── introspection-warning │ └── schema.sql ├── jira │ ├── README.md │ └── schema.sql ├── joomla │ ├── README.md │ └── schema.sql ├── kanboard │ ├── README.md │ └── schema.sql ├── koken │ ├── README.md │ ├── data.sql │ └── schema.sql ├── limesurvey │ ├── README.md │ ├── data.sql │ └── schema.sql ├── lychee │ ├── README.md │ └── schema.sql ├── magento │ ├── README.md │ └── schema.sql ├── mantis │ ├── README.md │ └── schema.sql ├── mapos │ ├── README.md │ └── schema.sql ├── matomo │ ├── README.md │ └── schema.sql ├── mediawiki │ ├── README.md │ └── schema.sql ├── modx-revolution │ ├── README.md │ └── schema.sql ├── modx │ ├── README.md │ ├── data.sql │ └── schema.sql ├── moodle │ ├── README.md │ ├── data.sql │ └── schema.sql ├── movielens │ ├── README.md │ └── schema.sql ├── mybb │ ├── README.md │ └── schema.sql ├── nextcloud │ ├── README.md │ └── schema.sql ├── northwind │ ├── README.md │ └── schema.sql ├── okky │ ├── README.md │ └── schema.sql ├── opencart │ ├── README.md │ ├── data.sql │ └── schema.sql ├── openclassifieds │ ├── README.md │ ├── data.sql │ └── schema.sql ├── opendocman │ ├── README.md │ ├── data.sql │ └── schema.sql ├── orangehrm │ ├── README.md │ ├── data.sql │ └── schema.sql ├── osclass │ ├── README.md │ ├── data.sql │ └── schema.sql ├── oscommerce │ ├── README.md │ └── schema.sql ├── owncloud │ ├── README.md │ └── schema.sql ├── phpbb │ ├── README.md │ └── schema.sql ├── phplist │ ├── README.md │ ├── data.sql │ └── schema.sql ├── phpmychat │ ├── README.md │ ├── data.sql │ └── schema.sql ├── phpmyfaq │ ├── README.md │ └── schema.sql ├── piwigo │ ├── README.md │ └── schema.sql ├── prestashop │ ├── README.md │ └── schema.sql ├── rido │ ├── README.md │ └── schema.sql ├── sakila │ ├── README.md │ └── schema.sql ├── shopware │ ├── README.md │ └── schema.sql ├── simpeg │ ├── README.md │ └── schema.sql ├── smf │ ├── README.md │ ├── data.sql │ └── schema.sql ├── sportsdb │ ├── README.md │ ├── data.sql │ └── schema.sql ├── thinkadmin │ ├── README.md │ └── schema.sql ├── tikiwiki │ ├── README.md │ ├── data.sql │ └── schema.sql ├── typo3-v8 │ ├── README.md │ └── schema.sql ├── typo3-v9 │ ├── README.md │ └── schema.sql ├── vanilla │ ├── README.md │ └── schema.sql ├── wbce │ ├── README.md │ └── schema.sql ├── wikimedia │ ├── README.md │ └── schema.sql ├── wordpress │ ├── README.md │ └── schema.sql ├── worldservantsdoetinchem │ ├── README.md │ └── schema.sql ├── xoops │ ├── README.md │ ├── data.sql │ └── schema.sql ├── xpressengine │ ├── README.md │ └── schema.sql ├── youngcart5 │ ├── README.md │ └── schema.sql ├── yourls │ ├── README.md │ ├── data.sql │ └── schema.sql ├── zencart │ ├── README.md │ └── schema.sql └── zenphoto │ ├── README.md │ ├── data.sql │ └── schema.sql ├── mysql_academic └── mysql_127 │ ├── README.md │ └── schema.sql ├── postgres ├── aragon-notification-service │ ├── README.md │ └── schema.sql ├── basic-blog │ ├── Readme.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── basic-twitter │ ├── Readme.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── canvas-lms │ ├── README.md │ ├── data.sql │ └── schema.sql ├── chinook │ ├── README.md │ ├── data.sql │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── cms-utilization-db │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── discourse │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── exo │ ├── README.md │ ├── data.sql │ └── schema.sql ├── gitlab │ ├── README.md │ └── schema.sql ├── helpdesk │ ├── README.md │ └── schema.sql ├── jira │ ├── README.md │ ├── data.sql │ └── schema.sql ├── mastodon │ ├── README.md │ ├── data.sql │ └── schema.sql ├── niko-public-1 │ ├── README.md │ └── schema.sql ├── noalyss-account │ ├── README.md │ ├── data.sql │ └── schema.sql ├── noalyss-folder │ ├── README.md │ ├── data.sql │ └── schema.sql ├── northwind │ ├── README.md │ ├── data.sql │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── odoo │ ├── README.md │ ├── data.sql │ └── schema.sql ├── opendota │ ├── README.md │ └── schema.sql ├── ruma │ ├── README.md │ └── schema.sql ├── sakila │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── shakespeare │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── sonarqube │ ├── README.md │ ├── data.sql │ └── schema.sql ├── sportsdb │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql └── standup-slack-bot │ ├── README.md │ ├── datamodel-1.0.groovy │ ├── datamodel-1.1.groovy │ ├── datamodel-1col-2.0.groovy │ ├── datamodel-2col-2.0.groovy │ ├── datamodel-3col-2.0.groovy │ └── schema.sql ├── scripts └── docker │ ├── README.md │ ├── build.sh │ ├── docker-compose.yml │ ├── mssql │ └── docker-compose.yml │ ├── mysql │ ├── Dockerfile │ ├── VERSION │ └── mysqld.cnf │ └── postgresql │ ├── Dockerfile │ └── VERSION └── sqlite ├── basic_tests ├── models │ ├── table.db │ ├── table.prisma │ ├── table_with_compound_primary_key.db │ ├── table_with_compound_primary_key.prisma │ ├── table_with_default_datetime_now.db │ ├── table_with_default_datetime_now.prisma │ ├── table_with_default_values.db │ ├── table_with_default_values.prisma │ ├── table_with_gql_types.db │ ├── table_with_gql_types.prisma │ ├── table_with_index.db │ ├── table_with_index.prisma │ ├── table_with_multi_column_index.db │ ├── table_with_multi_column_index.prisma │ ├── table_with_multi_column_unique.db │ ├── table_with_multi_column_unique.prisma │ ├── table_with_optional_and_required_columns.db │ ├── table_with_optional_and_required_columns.prisma │ ├── table_with_optional_primary_key.db │ ├── table_with_optional_primary_key.prisma │ ├── table_with_sequence_id.db │ ├── table_with_sequence_id.prisma │ ├── table_with_unique_with_index.db │ ├── table_with_unique_with_index.prisma │ ├── table_with_unique_without_index.db │ └── table_with_unique_without_index.prisma └── relations │ ├── relation_1-1.db │ ├── relation_1-1.prisma │ ├── relation_1-1req.db │ ├── relation_1-1req.prisma │ ├── relation_1-M.db │ ├── relation_1-M.prisma │ ├── relation_1req-M.db │ └── relation_1req-M.prisma ├── openfootball ├── README.md └── schema.db ├── sample_schemas ├── Northwind_small.prisma ├── Northwind_small.sqlite ├── chinook.db └── chinook.prisma └── sql-mysteries ├── README.md └── schema.db /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | 4 | env: 5 | CI: 1 6 | DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} 7 | 8 | jobs: 9 | publish-to-docker: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - run: sh scripts/docker/build.sh ${{ github.event.inputs.dockerTag }} 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | data/ 3 | .* 4 | /env -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PG_URL ?= postgres://localhost:5432 2 | PG_SCHEMAS := $(wildcard postgres/*/schema.sql) 3 | PG_DATAMODELS := \ 4 | $(PG_SCHEMAS:schema.sql=datamodel-1.0.groovy) \ 5 | $(PG_SCHEMAS:schema.sql=datamodel-1.1.groovy) \ 6 | $(PG_SCHEMAS:schema.sql=datamodel-1col-2.0.groovy) \ 7 | $(PG_SCHEMAS:schema.sql=datamodel-2col-2.0.groovy) \ 8 | $(PG_SCHEMAS:schema.sql=datamodel-3col-2.0.groovy) 9 | 10 | render: dep $(PG_DATAMODELS) 11 | dep: dep.psql dep.groovy-render 12 | 13 | # psql dependency 14 | psql := $(shell command -v psql) 15 | dep.psql: 16 | ifndef psql 17 | @echo 'Required dependency not found: psql' 18 | @exit 1 19 | endif 20 | 21 | # prisma-render dependency 22 | # TODO: integrate with prisma-cli 23 | prisma-render := $(shell command -v prisma-render) 24 | dep.groovy-render: 25 | ifndef prisma-render 26 | @echo 'Required dependency not found: prisma-render' 27 | @exit 1 28 | endif 29 | 30 | postgres/%/datamodel-1.0.groovy: postgres/%/schema.sql 31 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 32 | @psql -c "create database tmp_prisma" $(PG_URL) 33 | @psql $(PG_URL)/tmp_prisma < $? 34 | @prisma-render --datamodel 1.0 $(PG_URL)/tmp_prisma > $@ 35 | @psql -c "drop database tmp_prisma" $(PG_URL) 36 | 37 | postgres/%/datamodel-1.1.groovy: postgres/%/schema.sql 38 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 39 | @ psql -c "create database tmp_prisma" $(PG_URL) 40 | @ psql $(PG_URL)/tmp_prisma < $? 41 | @ prisma-render --datamodel 1.1 $(PG_URL)/tmp_prisma > $@ 42 | @ psql -c "drop database tmp_prisma" $(PG_URL) 43 | 44 | postgres/%/datamodel-1col-2.0.groovy: postgres/%/schema.sql 45 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 46 | @ psql -c "create database tmp_prisma" $(PG_URL) 47 | @ psql $(PG_URL)/tmp_prisma < $? 48 | @ prisma-render --datamodel 2.0 --columns 1 $(PG_URL)/tmp_prisma > $@ 49 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 50 | 51 | postgres/%/datamodel-2col-2.0.groovy: postgres/%/schema.sql 52 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 53 | @ psql -c "create database tmp_prisma" $(PG_URL) 54 | @ psql $(PG_URL)/tmp_prisma < $? 55 | @ prisma-render --datamodel 2.0 --columns 2 $(PG_URL)/tmp_prisma > $@ 56 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 57 | 58 | postgres/%/datamodel-3col-2.0.groovy: postgres/%/schema.sql 59 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 60 | @ psql -c "create database tmp_prisma" $(PG_URL) 61 | @ psql $(PG_URL)/tmp_prisma < $? 62 | @ prisma-render --datamodel 2.0 --columns 3 $(PG_URL)/tmp_prisma > $@ 63 | @ psql -c "drop database if exists tmp_prisma" $(PG_URL) 64 | 65 | clear.all: 66 | @ rm -rf ./postgres/*/*.{prisma,groovy,graphql} 67 | 68 | clear.2.0: 69 | @ rm -rf ./postgres/*/datamodel-*-2.0.* -------------------------------------------------------------------------------- /POSTGRES.md: -------------------------------------------------------------------------------- 1 | # Postgres Instructions 2 | 3 | ## Getting a database dump 4 | 5 | Use `pg_dump` in "schema-only" mode: 6 | 7 | ``` 8 | pg_dump --dbname=$dbname --host=$host --port=$port --no-owner --no-privileges --schema-only --no-security-labels 9 | ``` 10 | 11 | Write to a file named `schema.sql`. 12 | 13 | ## Recompile the datamodels 14 | 15 | You'll need Postgres installed locally with `psql` in your `$PATH` and the [prisma-render](https://github.com/prisma/prisma-render) CLI in your `$PATH`. 16 | 17 | Then run: 18 | 19 | ```sh 20 | git clone https://github.com/prisma/database-schema-examples 21 | cd database-schema-examples 22 | make 23 | ``` 24 | 25 | If you don't have Postgres installed locally or you want to load these schemas into a remote Postgres instance, you can use the environment variable PG_URL=postgres:// 26 | 27 | ```sh 28 | PG_URL=postgres://... make 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Database Schema Examples 2 | 3 | This repository contains examples for database schemas, grouped by database. Useful whenever we need a real world example, for example for testing [Prisma Introspection](https://www.prisma.io/docs/reference/tools-and-interfaces/introspection) or [Prisma Client](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). 4 | 5 | Each example folder contains a `README.md` that contains the link to the original source of the example. It also mentions changes that were applied compared to the original source. 6 | -------------------------------------------------------------------------------- /mssql/adventureWorks2012/README.md: -------------------------------------------------------------------------------- 1 | ## AdventureWorks2012 2 | 3 | - website: https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sqlallproducts-allversions&tabs=ssms 4 | - source: AdventureWorksLT2012.bak 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - Schema name manually switched to dbo instead of SalesLT. 10 | -------------------------------------------------------------------------------- /mssql/adventureWorks2014/README.md: -------------------------------------------------------------------------------- 1 | ## AdventureWorks2014 2 | 3 | - website: https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sqlallproducts-allversions&tabs=ssms 4 | - source: AdventureWorksLT2014.bak 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - Schema name manually switched to dbo instead of SalesLT. -------------------------------------------------------------------------------- /mssql/adventureWorks2016/README.md: -------------------------------------------------------------------------------- 1 | ## AdventureWorks2016 2 | 3 | - website: https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sqlallproducts-allversions&tabs=ssms 4 | - source: AdventureWorksLT2016.bak 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - Schema name manually switched to dbo instead of SalesLT. -------------------------------------------------------------------------------- /mssql/adventureWorks2017/README.md: -------------------------------------------------------------------------------- 1 | ## AdventureWorks2017 2 | 3 | - website: https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sqlallproducts-allversions&tabs=ssms 4 | - source: AdventureWorksLT2017.bak 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - Schema name manually switched to dbo instead of SalesLT. -------------------------------------------------------------------------------- /mssql/adventureWorks2019/README.md: -------------------------------------------------------------------------------- 1 | ## AdventureWorks2019 2 | 3 | - website: https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sqlallproducts-allversions&tabs=ssms 4 | - source: AdventureWorksLT2019.bak 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - The adventure works databases cannot exist on the same SQLServer concurrently because the .baks were generated with the same files (/var/opt/mssql/data/EmployeeCaseStudyData.mdf and /var/opt/mssql/data/AdventureWorksLT2012_log.ldf) 10 | - To restore them I had to delete each existing db from restored .bak and then recreate individually. 11 | - Schema name manually switched to dbo instead of SalesLT. 12 | -------------------------------------------------------------------------------- /mssql/bikeStores/README.md: -------------------------------------------------------------------------------- 1 | ## bikesStores 2 | 3 | - website: https://www.sqlservertutorial.net/sql-server-sample-database/ 4 | 5 | ## Modifications made to source 6 | 7 | - maually change schemas to dbo -------------------------------------------------------------------------------- /mssql/bikeStores/schema.sql: -------------------------------------------------------------------------------- 1 | /* 2 | -------------------------------------------------------------------- 3 | © 2017 sqlservertutorial.net All Rights Reserved 4 | -------------------------------------------------------------------- 5 | Name : BikeStores 6 | Link : http://www.sqlservertutorial.net/load-sample-database/ 7 | Version: 1.0 8 | -------------------------------------------------------------------- 9 | */ 10 | 11 | -- create tables 12 | CREATE TABLE dbo.categories ( 13 | category_id INT IDENTITY (1, 1) PRIMARY KEY, 14 | category_name VARCHAR (255) NOT NULL 15 | ); 16 | 17 | CREATE TABLE dbo.brands ( 18 | brand_id INT IDENTITY (1, 1) PRIMARY KEY, 19 | brand_name VARCHAR (255) NOT NULL 20 | ); 21 | 22 | CREATE TABLE dbo.products ( 23 | product_id INT IDENTITY (1, 1) PRIMARY KEY, 24 | product_name VARCHAR (255) NOT NULL, 25 | brand_id INT NOT NULL, 26 | category_id INT NOT NULL, 27 | model_year SMALLINT NOT NULL, 28 | list_price DECIMAL (10, 2) NOT NULL, 29 | FOREIGN KEY (category_id) REFERENCES dbo.categories (category_id) ON DELETE CASCADE ON UPDATE CASCADE, 30 | FOREIGN KEY (brand_id) REFERENCES dbo.brands (brand_id) ON DELETE CASCADE ON UPDATE CASCADE 31 | ); 32 | 33 | CREATE TABLE dbo.customers ( 34 | customer_id INT IDENTITY (1, 1) PRIMARY KEY, 35 | first_name VARCHAR (255) NOT NULL, 36 | last_name VARCHAR (255) NOT NULL, 37 | phone VARCHAR (25), 38 | email VARCHAR (255) NOT NULL, 39 | street VARCHAR (255), 40 | city VARCHAR (50), 41 | state VARCHAR (25), 42 | zip_code VARCHAR (5) 43 | ); 44 | 45 | CREATE TABLE dbo.stores ( 46 | store_id INT IDENTITY (1, 1) PRIMARY KEY, 47 | store_name VARCHAR (255) NOT NULL, 48 | phone VARCHAR (25), 49 | email VARCHAR (255), 50 | street VARCHAR (255), 51 | city VARCHAR (255), 52 | state VARCHAR (10), 53 | zip_code VARCHAR (5) 54 | ); 55 | 56 | CREATE TABLE dbo.staffs ( 57 | staff_id INT IDENTITY (1, 1) PRIMARY KEY, 58 | first_name VARCHAR (50) NOT NULL, 59 | last_name VARCHAR (50) NOT NULL, 60 | email VARCHAR (255) NOT NULL UNIQUE, 61 | phone VARCHAR (25), 62 | active tinyint NOT NULL, 63 | store_id INT NOT NULL, 64 | manager_id INT, 65 | FOREIGN KEY (store_id) REFERENCES dbo.stores (store_id) ON DELETE CASCADE ON UPDATE CASCADE, 66 | FOREIGN KEY (manager_id) REFERENCES dbo.staffs (staff_id) ON DELETE NO ACTION ON UPDATE NO ACTION 67 | ); 68 | 69 | CREATE TABLE dbo.orders ( 70 | order_id INT IDENTITY (1, 1) PRIMARY KEY, 71 | customer_id INT, 72 | order_status tinyint NOT NULL, 73 | -- Order status: 1 = Pending; 2 = Processing; 3 = Rejected; 4 = Completed 74 | order_date DATE NOT NULL, 75 | required_date DATE NOT NULL, 76 | shipped_date DATE, 77 | store_id INT NOT NULL, 78 | staff_id INT NOT NULL, 79 | FOREIGN KEY (customer_id) REFERENCES dbo.customers (customer_id) ON DELETE CASCADE ON UPDATE CASCADE, 80 | FOREIGN KEY (store_id) REFERENCES dbo.stores (store_id) ON DELETE CASCADE ON UPDATE CASCADE, 81 | FOREIGN KEY (staff_id) REFERENCES dbo.staffs (staff_id) ON DELETE NO ACTION ON UPDATE NO ACTION 82 | ); 83 | 84 | CREATE TABLE dbo.order_items ( 85 | order_id INT, 86 | item_id INT, 87 | product_id INT NOT NULL, 88 | quantity INT NOT NULL, 89 | list_price DECIMAL (10, 2) NOT NULL, 90 | discount DECIMAL (4, 2) NOT NULL DEFAULT 0, 91 | PRIMARY KEY (order_id, item_id), 92 | FOREIGN KEY (order_id) REFERENCES dbo.orders (order_id) ON DELETE CASCADE ON UPDATE CASCADE, 93 | FOREIGN KEY (product_id) REFERENCES dbo.products (product_id) ON DELETE CASCADE ON UPDATE CASCADE 94 | ); 95 | 96 | CREATE TABLE dbo.stocks ( 97 | store_id INT, 98 | product_id INT, 99 | quantity INT, 100 | PRIMARY KEY (store_id, product_id), 101 | FOREIGN KEY (store_id) REFERENCES dbo.stores (store_id) ON DELETE CASCADE ON UPDATE CASCADE, 102 | FOREIGN KEY (product_id) REFERENCES dbo.products (product_id) ON DELETE CASCADE ON UPDATE CASCADE 103 | ); -------------------------------------------------------------------------------- /mssql/chinook/README.md: -------------------------------------------------------------------------------- 1 | ## chinook 2 | 3 | - website: https://github.com/lerocha/chinook-database/tree/master/ChinookDatabase/DataSources 4 | - source: Chinook_SqlServer.sql 5 | 6 | ## Modifications made to source -------------------------------------------------------------------------------- /mssql/employeeCaseStudy/README.md: -------------------------------------------------------------------------------- 1 | ## EmployeeCaseStudy 2 | 3 | - website: https://www.sqlskills.com/sql-server-resources/sql-server-demos/ 4 | - source: https://www.sqlskills.com/resources/conferences/EmployeeCaseStudySampleDB2012.zip 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 9 | - data.sql size manually reduced to 20 rows per table. 10 | -------------------------------------------------------------------------------- /mssql/exo/README.md: -------------------------------------------------------------------------------- 1 | # exo 2 | 3 | - version: 6.0 4 | - website: https://www.exoplatform.com/ 5 | - source: https://hub.docker.com/r/exoplatform/exo 6 | 7 | ## Modifications made to source 8 | 9 | - schema from postgres folder in same repo 10 | - schema initially exported via `pg_dump` 11 | - converted using http://www.sqlines.com/online 12 | - data.sql adapted from half of corresponding file in mysql folder in same repo 13 | 14 | - remove extensions and settings 15 | - remove statements containing word OWNER because not recognized by sql server 16 | - remove word ONLY because not recognized by sql server 17 | - remove statements creating binary trees with word USING because not recognized by sql server 18 | - remove lock and unlock table statements 19 | 20 | - replace boolean with bit 21 | - replace false with 0 22 | - replace true with 1 23 | - replace bytea with VARBINARY(100) 24 | - replace oid with character varying(100) 25 | - replace __binary'\0' with 1 or 0 26 | - replace '\s to ''s -------------------------------------------------------------------------------- /mssql/gitlab/README.md: -------------------------------------------------------------------------------- 1 | # gitlab 2 | 3 | - website: https://gitlab.com/gitlab-org/gitlab/issues/29465 4 | - source: http://www.sqlines.com/online 5 | 6 | ## Modifications made to source 7 | 8 | - schema from postgres folder in same repo 9 | - schema initially exported via `pg_dump` 10 | - converted using http://www.sqlines.com/online 11 | 12 | - remove extensions and settings 13 | - remove statements creating binary trees with word USING because not recognized by sql server 14 | - remove next value indexes 15 | - remove migration rows > 10000 in insert statemenet as sql server only accepts 1000 in one batch 16 | 17 | - replace boolean with bit 18 | - replace false with 0 19 | - replace true with 1 20 | - replace bytea with VARBINARY(100) 21 | - replace oid with character varying(100) 22 | - replace timestamp with datetime 23 | - replace ::character with character 24 | - replace bytea with VARBINARY(100) 25 | - replace character with VARCHAR(255) 26 | - replace jsonb with nvarchar 27 | - replace ON DELETE RESTRICT with ON DELETE NO ACTION 28 | - replace key with key_base 29 | - replace file with file_base 30 | - replace external with external_base 31 | - replace trigger with trigger_base 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mssql/gitlab/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO dbo.schema_migrations (version) VALUES 2 | ('20140313092127'), 3 | ('20140407135544'), 4 | ('20140414131055'), 5 | ('20140415124820'), 6 | ('20140416074002'), 7 | ('20140416185734'), 8 | ('20140428105831'), 9 | ('20140502115131'), 10 | ('20140502125220'), 11 | ('20140611135229'), 12 | ('20140625115202'), 13 | ('20140729134820'), 14 | ('20140729140420'), 15 | ('20140729145339'), 16 | ('20140729152420'), 17 | ('20140730111702'), 18 | ('20140903115954'), 19 | ('20140907220153'), 20 | ('20140914113604'), 21 | ('20140914145549'), 22 | ('20140914173417'), 23 | ('20141006143943'), 24 | ('20141007100818'), 25 | ('20141118150935'), 26 | ('20141121133009'), 27 | ('20141121161704'), 28 | ('20141126120926'), 29 | ('20141205134006'), 30 | ('20141216155758'), 31 | ('20141217125223'), 32 | ('20141223135007'), 33 | ('20141226080412'), 34 | ('20150108073740'), 35 | ('20150116234544'), 36 | ('20150116234545'), 37 | ('20150125163100'), 38 | ('20150205211843'), 39 | ('20150206181414'), 40 | ('20150206222854'), 41 | ('20150209222013'), 42 | ('20150211172122'), 43 | ('20150211174341'), 44 | ('20150213104043'), 45 | ('20150213114800'), 46 | ('20150213121042'), 47 | ('20150217123345'), 48 | ('20150219004514'), 49 | ('20150223022001'), 50 | ('20150225065047'), 51 | ('20150301014758'), 52 | ('20150306023106'), 53 | ('20150306023112'), 54 | ('20150310194358'), 55 | ('20150313012111'), 56 | ('20150320234437'), 57 | ('20150324155957'), 58 | ('20150327122227'), 59 | ('20150327150017'), 60 | ('20150327223628'), 61 | ('20150328132231'), 62 | ('20150331183602'), 63 | ('20150406133311'), 64 | ('20150411000035'), 65 | ('20150411180045'), 66 | ('20150413192223'), 67 | ('20150417121913'), 68 | ('20150417122318'), 69 | ('20150421120000'), 70 | ('20150423033240'), 71 | ('20150425164646'), 72 | ('20150425164647'), 73 | ('20150425164648'), 74 | ('20150425164649'), 75 | ('20150425164650'), 76 | ('20150425164651'), 77 | ('20150425173433'), 78 | ('20150429002313'), 79 | ('20150502064022'), 80 | ('20150509180749'), 81 | ('20150516060434'), 82 | ('20150529111607'), 83 | ('20150529150354'), 84 | ('20150609141121'), 85 | ('20150610065936'), 86 | ('20150620233230'), 87 | ('20150713160110'), 88 | ('20150717130904'), 89 | ('20150730122406'), 90 | ('20150806104937'), 91 | ('20150812080800'), 92 | ('20150814065925'), 93 | ('20150817163600'), 94 | ('20150818213832'), 95 | ('20150824002011'), 96 | ('20150826001931'), 97 | ('20150827121444'), 98 | ('20150902001023'), 99 | ('20150914215247'), 100 | ('20150915001905'), 101 | ('20150916000405'), 102 | ('20150916114643'), 103 | ('20150916145038'), 104 | ('20150918084513'), 105 | ('20150918161719'), 106 | ('20150920010715'), 107 | ('20150920161119'), 108 | ('20150924125150'), 109 | ('20150924125436'), 110 | ('20150930001110'), 111 | ('20150930095736'), 112 | ('20150930110012'), 113 | ('20151002112914'), 114 | ('20151002121400'); -------------------------------------------------------------------------------- /mssql/helpdesk/README.md: -------------------------------------------------------------------------------- 1 | # helpdesk 2 | 3 | - website: https://www.totaljs.com/helpdesk/ 4 | 5 | ## Modifications made to source 6 | 7 | - schema from postgres folder in same repo 8 | - schema initially exported via `pg_dump` 9 | - converted using http://www.sqlines.com/online 10 | 11 | - remove extensions and settings 12 | - remove statments setting OID=false 13 | - remove last view as there was an issue casting the dates 14 | 15 | - replace create and alter views with begin -> execute() -> end -------------------------------------------------------------------------------- /mssql/helpdesk/data.sql: -------------------------------------------------------------------------------- 1 | -- CODELIST 2 | INSERT INTO cdl_label VALUES('bug'); 3 | INSERT INTO cdl_label VALUES('duplicate'); 4 | INSERT INTO cdl_label VALUES('enhancement'); 5 | INSERT INTO cdl_label VALUES('invalid'); 6 | INSERT INTO cdl_label VALUES('question'); 7 | INSERT INTO cdl_label VALUES('waiting for more info'); 8 | INSERT INTO cdl_label VALUES('wontfix'); 9 | 10 | INSERT INTO cdl_project VALUES('Adminer'); 11 | INSERT INTO cdl_project VALUES('Eshop + CMS'); 12 | INSERT INTO cdl_project VALUES('HelpDesk'); 13 | INSERT INTO cdl_project VALUES('jComponent'); 14 | INSERT INTO cdl_project VALUES('OpenPlatform'); 15 | INSERT INTO cdl_project VALUES('SuperAdmin'); 16 | INSERT INTO cdl_project VALUES('Total.js'); 17 | 18 | INSERT INTO cdl_language VALUES('en'); 19 | INSERT INTO tbl_user (id, token, name, language, company, "position", email, password, isadmin, isconfirmed, isnotification, isactivated) VALUES('16072309220001xlu1', '97z8ctkw16tu11tasmin5iefmmijyr', 'Peter Sirka', '', 'Total.js', 'Developer', 'support@totaljs.com', '7c4a8d09ca3762af61e59520943dc26494f8941b', true, true, true, true); 20 | 21 | -------------------------------------------------------------------------------- /mssql/hr/README.md: -------------------------------------------------------------------------------- 1 | # helpdesk 2 | 3 | - website: sqltutorial.org/sql-sample-database/ 4 | 5 | ## Modifications made to source -------------------------------------------------------------------------------- /mssql/hr/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE regions ( 2 | region_id INT IDENTITY(1,1) PRIMARY KEY, 3 | region_name VARCHAR (25) DEFAULT NULL 4 | ); 5 | 6 | CREATE TABLE countries ( 7 | country_id CHAR (2) PRIMARY KEY, 8 | country_name VARCHAR (40) DEFAULT NULL, 9 | region_id INT NOT NULL, 10 | FOREIGN KEY (region_id) REFERENCES regions (region_id) ON DELETE CASCADE ON UPDATE CASCADE 11 | ); 12 | 13 | CREATE TABLE locations ( 14 | location_id INT IDENTITY(1,1) PRIMARY KEY, 15 | street_address VARCHAR (40) DEFAULT NULL, 16 | postal_code VARCHAR (12) DEFAULT NULL, 17 | city VARCHAR (30) NOT NULL, 18 | state_province VARCHAR (25) DEFAULT NULL, 19 | country_id CHAR (2) NOT NULL, 20 | FOREIGN KEY (country_id) REFERENCES countries (country_id) ON DELETE CASCADE ON UPDATE CASCADE 21 | ); 22 | 23 | CREATE TABLE jobs ( 24 | job_id INT IDENTITY(1,1) PRIMARY KEY, 25 | job_title VARCHAR (35) NOT NULL, 26 | min_salary DECIMAL (8, 2) DEFAULT NULL, 27 | max_salary DECIMAL (8, 2) DEFAULT NULL 28 | ); 29 | 30 | CREATE TABLE departments ( 31 | department_id INT IDENTITY(1,1) PRIMARY KEY, 32 | department_name VARCHAR (30) NOT NULL, 33 | location_id INT DEFAULT NULL, 34 | FOREIGN KEY (location_id) REFERENCES locations (location_id) ON DELETE CASCADE ON UPDATE CASCADE 35 | ); 36 | 37 | CREATE TABLE employees ( 38 | employee_id INT IDENTITY(1,1) PRIMARY KEY, 39 | first_name VARCHAR (20) DEFAULT NULL, 40 | last_name VARCHAR (25) NOT NULL, 41 | email VARCHAR (100) NOT NULL, 42 | phone_number VARCHAR (20) DEFAULT NULL, 43 | hire_date DATE NOT NULL, 44 | job_id INT NOT NULL, 45 | salary DECIMAL (8, 2) NOT NULL, 46 | manager_id INT DEFAULT NULL, 47 | department_id INT DEFAULT NULL, 48 | FOREIGN KEY (job_id) REFERENCES jobs (job_id) ON DELETE CASCADE ON UPDATE CASCADE, 49 | FOREIGN KEY (department_id) REFERENCES departments (department_id) ON DELETE CASCADE ON UPDATE CASCADE, 50 | FOREIGN KEY (manager_id) REFERENCES employees (employee_id) 51 | ); 52 | 53 | CREATE TABLE dependents ( 54 | dependent_id INT IDENTITY(1,1) PRIMARY KEY, 55 | first_name VARCHAR (50) NOT NULL, 56 | last_name VARCHAR (50) NOT NULL, 57 | relationship VARCHAR (25) NOT NULL, 58 | employee_id INT NOT NULL, 59 | FOREIGN KEY (employee_id) REFERENCES employees (employee_id) ON DELETE CASCADE ON UPDATE CASCADE 60 | ); -------------------------------------------------------------------------------- /mssql/katmai/README.md: -------------------------------------------------------------------------------- 1 | # katmai 2 | 3 | - website: https://en.wikibooks.org/wiki/Microsoft_SQL_Server/Geospatial_Data/Example_Database_Code 4 | 5 | ## Modifications made to source 6 | 7 | - remove `DISABLE_BROKER off` and `DATE_CORRELATION_OPTIMIZATION off` statements which causes database client to hang -------------------------------------------------------------------------------- /mssql/katmai/schema.sql: -------------------------------------------------------------------------------- 1 | USE [katmai] 2 | GO 3 | ALTER DATABASE [katmai] SET COMPATIBILITY_LEVEL = 100 4 | GO 5 | 6 | IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) 7 | begin 8 | EXEC [katmai].[dbo].[sp_fulltext_database] @action = 'enable' 9 | end 10 | GO 11 | 12 | ALTER DATABASE [katmai] SET ANSI_NULL_DEFAULT OFF 13 | GO 14 | 15 | ALTER DATABASE [katmai] SET ANSI_NULLS OFF 16 | GO 17 | 18 | ALTER DATABASE [katmai] SET ANSI_PADDING OFF 19 | GO 20 | 21 | ALTER DATABASE [katmai] SET ANSI_WARNINGS OFF 22 | GO 23 | 24 | ALTER DATABASE [katmai] SET ARITHABORT OFF 25 | GO 26 | 27 | ALTER DATABASE [katmai] SET AUTO_CLOSE OFF 28 | GO 29 | 30 | ALTER DATABASE [katmai] SET AUTO_CREATE_STATISTICS ON 31 | GO 32 | 33 | ALTER DATABASE [katmai] SET AUTO_SHRINK OFF 34 | GO 35 | 36 | ALTER DATABASE [katmai] SET AUTO_UPDATE_STATISTICS ON 37 | GO 38 | 39 | ALTER DATABASE [katmai] SET CURSOR_CLOSE_ON_COMMIT OFF 40 | GO 41 | 42 | ALTER DATABASE [katmai] SET CURSOR_DEFAULT GLOBAL 43 | GO 44 | 45 | ALTER DATABASE [katmai] SET CONCAT_NULL_YIELDS_NULL OFF 46 | GO 47 | 48 | ALTER DATABASE [katmai] SET NUMERIC_ROUNDABORT OFF 49 | GO 50 | 51 | ALTER DATABASE [katmai] SET QUOTED_IDENTIFIER OFF 52 | GO 53 | 54 | ALTER DATABASE [katmai] SET RECURSIVE_TRIGGERS OFF 55 | GO 56 | 57 | -- ALTER DATABASE [katmai] SET DISABLE_BROKER 58 | -- GO 59 | 60 | ALTER DATABASE [katmai] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 61 | GO 62 | 63 | -- ALTER DATABASE [katmai] SET DATE_CORRELATION_OPTIMIZATION OFF 64 | -- GO 65 | 66 | ALTER DATABASE [katmai] SET TRUSTWORTHY OFF 67 | GO 68 | 69 | ALTER DATABASE [katmai] SET ALLOW_SNAPSHOT_ISOLATION OFF 70 | GO 71 | 72 | ALTER DATABASE [katmai] SET PARAMETERIZATION SIMPLE 73 | GO 74 | 75 | ALTER DATABASE [katmai] SET READ_COMMITTED_SNAPSHOT OFF 76 | GO 77 | 78 | ALTER DATABASE [katmai] SET HONOR_BROKER_PRIORITY OFF 79 | GO 80 | 81 | ALTER DATABASE [katmai] SET READ_WRITE 82 | GO 83 | 84 | ALTER DATABASE [katmai] SET RECOVERY SIMPLE 85 | GO 86 | 87 | ALTER DATABASE [katmai] SET MULTI_USER 88 | GO 89 | 90 | ALTER DATABASE [katmai] SET PAGE_VERIFY CHECKSUM 91 | GO 92 | 93 | ALTER DATABASE [katmai] SET DB_CHAINING OFF 94 | GO 95 | 96 | USE [katmai] 97 | GO 98 | 99 | SET ANSI_NULLS ON 100 | GO 101 | 102 | SET QUOTED_IDENTIFIER ON 103 | GO 104 | 105 | CREATE TABLE [dbo].[ParkBoundaries]( 106 | [ID] [int] NOT NULL PRIMARY KEY, 107 | [Name] [nvarchar](255) NULL, 108 | [BoundaryType] [nvarchar](255) NULL, 109 | [geom] [geometry] NULL 110 | ) 111 | 112 | GO -------------------------------------------------------------------------------- /mssql/learningSql/README.md: -------------------------------------------------------------------------------- 1 | # learningSql 2 | 3 | - website: https://o7planning.org/en/10241/sample-sql-server-database-for-learning-sql#a23461 4 | 5 | ## Modifications made to source -------------------------------------------------------------------------------- /mssql/learningSql/schema.sql: -------------------------------------------------------------------------------- 1 | create table ACCOUNT ( 2 | ACCOUNT_ID int identity not null, 3 | AVAIL_BALANCE float, 4 | CLOSE_DATE datetime, 5 | LAST_ACTIVITY_DATE datetime, 6 | OPEN_DATE datetime not null, 7 | PENDING_BALANCE float, 8 | STATUS varchar(10), 9 | CUST_ID int, 10 | OPEN_BRANCH_ID int not null, 11 | OPEN_EMP_ID int not null, 12 | PRODUCT_CD varchar(10) not null, 13 | primary key (ACCOUNT_ID) 14 | ); 15 | 16 | create table ACC_TRANSACTION ( 17 | TXN_ID numeric(19,0) identity not null, 18 | AMOUNT float not null, 19 | FUNDS_AVAIL_DATE datetime not null, 20 | TXN_DATE datetime not null, 21 | TXN_TYPE_CD varchar(10), 22 | ACCOUNT_ID int, 23 | EXECUTION_BRANCH_ID int, 24 | TELLER_EMP_ID int, 25 | primary key (TXN_ID) 26 | ); 27 | 28 | create table BRANCH ( 29 | BRANCH_ID int identity not null, 30 | ADDRESS varchar(30), 31 | CITY varchar(20), 32 | NAME varchar(20) not null, 33 | STATE varchar(10), 34 | ZIP_CODE varchar(12), 35 | primary key (BRANCH_ID) 36 | ); 37 | 38 | create table BUSINESS ( 39 | INCORP_DATE datetime, 40 | NAME varchar(255) not null, 41 | STATE_ID varchar(10) not null, 42 | CUST_ID int not null, 43 | primary key (CUST_ID) 44 | ); 45 | 46 | create table CUSTOMER ( 47 | CUST_ID int identity not null, 48 | ADDRESS varchar(30), 49 | CITY varchar(20), 50 | CUST_TYPE_CD varchar(1) not null, 51 | FED_ID varchar(12) not null, 52 | POSTAL_CODE varchar(10), 53 | STATE varchar(20), 54 | primary key (CUST_ID) 55 | ); 56 | 57 | create table DEPARTMENT ( 58 | DEPT_ID int identity not null, 59 | NAME varchar(20) not null, 60 | primary key (DEPT_ID) 61 | ); 62 | 63 | create table EMPLOYEE ( 64 | EMP_ID int identity not null, 65 | END_DATE datetime, 66 | FIRST_NAME varchar(20) not null, 67 | LAST_NAME varchar(20) not null, 68 | START_DATE datetime not null, 69 | TITLE varchar(20), 70 | ASSIGNED_BRANCH_ID int, 71 | DEPT_ID int, 72 | SUPERIOR_EMP_ID int, 73 | primary key (EMP_ID) 74 | ); 75 | 76 | create table INDIVIDUAL ( 77 | BIRTH_DATE datetime, 78 | FIRST_NAME varchar(30) not null, 79 | LAST_NAME varchar(30) not null, 80 | CUST_ID int not null, 81 | primary key (CUST_ID) 82 | ); 83 | 84 | create table OFFICER ( 85 | OFFICER_ID int identity not null, 86 | END_DATE datetime, 87 | FIRST_NAME varchar(30) not null, 88 | LAST_NAME varchar(30) not null, 89 | START_DATE datetime not null, 90 | TITLE varchar(20), 91 | CUST_ID int, 92 | primary key (OFFICER_ID) 93 | ); 94 | 95 | create table PRODUCT ( 96 | PRODUCT_CD varchar(10) not null, 97 | DATE_OFFERED datetime, 98 | DATE_RETIRED datetime, 99 | NAME varchar(50) not null, 100 | PRODUCT_TYPE_CD varchar(255), 101 | primary key (PRODUCT_CD) 102 | ); 103 | 104 | create table PRODUCT_TYPE ( 105 | PRODUCT_TYPE_CD varchar(255) not null, 106 | NAME varchar(50), 107 | primary key (PRODUCT_TYPE_CD) 108 | ); 109 | 110 | alter table ACCOUNT 111 | add constraint ACCOUNT_CUSTOMER_FK 112 | foreign key (CUST_ID) 113 | references CUSTOMER; 114 | 115 | alter table ACCOUNT 116 | add constraint ACCOUNT_BRANCH_FK 117 | foreign key (OPEN_BRANCH_ID) 118 | references BRANCH; 119 | 120 | alter table ACCOUNT 121 | add constraint ACCOUNT_EMPLOYEE_FK 122 | foreign key (OPEN_EMP_ID) 123 | references EMPLOYEE; 124 | 125 | alter table ACCOUNT 126 | add constraint ACCOUNT_PRODUCT_FK 127 | foreign key (PRODUCT_CD) 128 | references PRODUCT; 129 | 130 | alter table ACC_TRANSACTION 131 | add constraint ACC_TRANSACTION_ACCOUNT_FK 132 | foreign key (ACCOUNT_ID) 133 | references ACCOUNT; 134 | 135 | alter table ACC_TRANSACTION 136 | add constraint ACC_TRANSACTION_BRANCH_FK 137 | foreign key (EXECUTION_BRANCH_ID) 138 | references BRANCH; 139 | 140 | alter table ACC_TRANSACTION 141 | add constraint ACC_TRANSACTION_EMPLOYEE_FK 142 | foreign key (TELLER_EMP_ID) 143 | references EMPLOYEE; 144 | 145 | alter table BUSINESS 146 | add constraint BUSINESS_EMPLOYEE_FK 147 | foreign key (CUST_ID) 148 | references CUSTOMER; 149 | 150 | alter table EMPLOYEE 151 | add constraint EMPLOYEE_BRANCH_FK 152 | foreign key (ASSIGNED_BRANCH_ID) 153 | references BRANCH; 154 | 155 | alter table EMPLOYEE 156 | add constraint EMPLOYEE_DEPARTMENT_FK 157 | foreign key (DEPT_ID) 158 | references DEPARTMENT; 159 | 160 | alter table EMPLOYEE 161 | add constraint EMPLOYEE_EMPLOYEE_FK 162 | foreign key (SUPERIOR_EMP_ID) 163 | references EMPLOYEE; 164 | 165 | alter table INDIVIDUAL 166 | add constraint INDIVIDUAL_CUSTOMER_FK 167 | foreign key (CUST_ID) 168 | references CUSTOMER; 169 | 170 | alter table OFFICER 171 | add constraint OFFICER_CUSTOMER_FK 172 | foreign key (CUST_ID) 173 | references CUSTOMER; 174 | 175 | alter table PRODUCT 176 | add constraint PRODUCT_PRODUCT_TYPE_FK 177 | foreign key (PRODUCT_TYPE_CD) 178 | references PRODUCT_TYPE; 179 | 180 | 181 | -------------------------------------------------------------------------------- /mssql/mastodon/README.md: -------------------------------------------------------------------------------- 1 | # mastodon 2 | 3 | - Website: https://joinmastodon.org/ 4 | - Source: https://docs.joinmastodon.org/admin/install/ 5 | 6 | ## Modifications made to source 7 | 8 | - schema from postgres folder in same repo 9 | - schema initially exported via `pg_dump` 10 | - converted using http://www.sqlines.com/online 11 | - data not adapted as it had a bunch of COPY from STDIN 12 | 13 | - remove extensions and settings 14 | - remove datetime_id function 15 | - remove unnecessary variable declarations throwing errors 16 | - remove word ONLY because not recognized by sql server 17 | - remove statements creating binary trees with word USING because not recognized by sql server 18 | - remove statements setting sequential ids with next value 19 | - remove ON DELETE CASCADE; 20 | 21 | - replace timestamp with datetime 22 | - replace armeta_data id with bigint 23 | - replace database with database_base 24 | - replace schema with schema_base 25 | - replace jsonb, json, inet to NVARCHAR(255) 26 | -------------------------------------------------------------------------------- /mssql/northwindPubs/README.md: -------------------------------------------------------------------------------- 1 | ## northwindPubs 2 | 3 | - website: from https://github.com/microsoft/sql-server-samples/tree/master/samples/databases 4 | - source: instpubs.sql 5 | 6 | ## Modifications made to source 7 | 8 | - .sql files generated from to Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 using mssql-scripter version 1.0.0a23 -------------------------------------------------------------------------------- /mssql/opendota/README.md: -------------------------------------------------------------------------------- 1 | # opendota 2 | 3 | - website: https://www.opendota.com/ 4 | 5 | 6 | ## Modifications made to source 7 | 8 | - schema from postgres folder in same repo 9 | - schema initially exported via `pg_dump` 10 | - converted using http://www.sqlines.com/online 11 | 12 | - remove extensions and settings 13 | - remove statements containing word OWNER because not recognized by sql server 14 | - remove word ONLY because not recognized by sql server 15 | - remove statements creating binary trees with word USING because not recognized by sql server 16 | - remove index creation statements to outside the create table statement or delete altogether 17 | 18 | - replace boolean with bit 19 | - replace false with 0 20 | - replace true with 1 21 | - replace jsbon, json[] with NVARCHAR 22 | - replace integer[] with integer 23 | - replace uuid with NVARCHAR 24 | - replace timestamp to datetime 25 | - replace text to nvarchar 26 | - replace varchar(max) to varchar(255) 27 | - replace key with key_base 28 | 29 | 30 | -------------------------------------------------------------------------------- /mssql/ruma/README.md: -------------------------------------------------------------------------------- 1 | # ruma 2 | 3 | - version: 8d0817090620f93dc9f421304154c7322f3ac6ab (Git hash) 4 | - website: https://www.ruma.io/ 5 | - source: https://github.com/ruma/ruma/blob/master/migrations/001_prerelease/up.sql 6 | 7 | ## Modifications made to source 8 | 9 | - schema from postgres folder in same repo 10 | - schema initially exported via `pg_dump` 11 | - converted using http://www.sqlines.com/online 12 | 13 | - remove extensions and settings 14 | - remove statements containing word OWNER because not recognized by sql server 15 | 16 | - replace default sequence index statements with correct syntax 17 | 18 | -------------------------------------------------------------------------------- /mssql/shakespeare/README.md: -------------------------------------------------------------------------------- 1 | # shakespeare 2 | 3 | - website: https://github.com/catherinedevlin/opensourceshakespeare 4 | 5 | ## Modifications made to source 6 | 7 | - schema from postgres folder in same repo 8 | - schema initially exported via `pg_dump` 9 | - converted using http://www.sqlines.com/online 10 | 11 | - remove extensions and settings 12 | - remove drop table if exists statements 13 | - remove ON DELETE CASCADE; -------------------------------------------------------------------------------- /mssql/shakespeare/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE work 2 | ( workID VARCHAR(32) PRIMARY KEY, 3 | title VARCHAR(32) NOT NULL, 4 | longTitle VARCHAR(64) NOT NULL, 5 | year INTEGER NOT NULL, 6 | genreType VARCHAR(1) NOT NULL, 7 | notes TEXT, 8 | source VARCHAR(16) NOT NULL, 9 | totalWords INTEGER NOT NULL, 10 | totalParagraphs INTEGER NOT NULL 11 | ); 12 | 13 | CREATE TABLE character 14 | ( charID VARCHAR(32) PRIMARY KEY, 15 | charName VARCHAR(64) NOT NULL, 16 | abbrev VARCHAR(32), 17 | works VARCHAR(256) NOT NULL, 18 | description VARCHAR(2056), 19 | speechCount INTEGER NOT NULL 20 | ); 21 | 22 | CREATE TABLE character_work 23 | ( charID VARCHAR(32) NOT NULL REFERENCES character (charID), 24 | workID VARCHAR(32) NOT NULL REFERENCES work (workID), 25 | PRIMARY KEY (charID, workID) 26 | ); 27 | 28 | ALTER TABLE character DROP COLUMN works; 29 | 30 | CREATE TABLE chapter 31 | ( workID VARCHAR(32) NOT NULL REFERENCES work (workID), 32 | chapterID INTEGER PRIMARY KEY, 33 | section INTEGER NOT NULL, 34 | chapter INTEGER NOT NULL, 35 | description VARCHAR(256) NOT NULL 36 | ); 37 | 38 | CREATE TABLE paragraph 39 | ( workID VARCHAR(32) NOT NULL REFERENCES work (workID), paragraphID INTEGER PRIMARY KEY NOT NULL, 40 | paragraphNum INTEGER NOT NULL, 41 | charID VARCHAR(32) NOT NULL REFERENCES character (charID), 42 | plainText TEXT NOT NULL, 43 | phoneticText TEXT NOT NULL, 44 | stemText TEXT NOT NULL, 45 | paragraphType VARCHAR(1) NOT NULL, 46 | section INTEGER NOT NULL, 47 | chapter INTEGER NOT NULL, 48 | charCount INTEGER NOT NULL, 49 | wordCount INTEGER NOT NULL 50 | ); 51 | 52 | CREATE TABLE wordform 53 | ( wordFormID INTEGER PRIMARY KEY, 54 | plainText VARCHAR(64) NOT NULL, 55 | phoneticText VARCHAR(64) NOT NULL, 56 | stemText VARCHAR(64) NOT NULL, 57 | occurences INTEGER NOT NULL 58 | ); 59 | 60 | -------------------------------------------------------------------------------- /mssql/sonarqube/README.md: -------------------------------------------------------------------------------- 1 | # sonarqube 2 | 3 | - version: 8.1 community beta 4 | - website: https://www.sonarqube.org/ 5 | - source: https://hub.docker.com/_/sonarqube/?tab=description 6 | 7 | ## Modifications made to source 8 | 9 | - schema from postgres folder in same repo 10 | - schema initially exported via `pg_dump` 11 | - converted using http://www.sqlines.com/online 12 | - data.sql not adapted 13 | 14 | - remove statements containing word OWNER because not recognized by sql server 15 | - remove word ONLY because not recognized by sql server 16 | - remove statements creating binary trees with word USING because not recognized by sql server 17 | 18 | - replace boolean with bit 19 | - replace false with 0 20 | - replace true with 1 21 | - replace bytea with VARBINARY(100) -------------------------------------------------------------------------------- /mssql/sportsdb/README.md: -------------------------------------------------------------------------------- 1 | ## sportsdb 2 | 3 | - website: http://www.sportsdb.org/sd/samples 4 | - source: https://docs.yugabyte.com/latest/sample-data/sportsdb/#about-the-sportsdb-sample-database 5 | 6 | ## Modifications made to source 7 | 8 | - schema from postgres folder in same repo 9 | - converted using http://www.sqlines.com/online 10 | 11 | - remove extensions and settings 12 | - remove word ONLY because not recognized by sql server 13 | - remove statements creating binary trees with word USING because not recognized by sql server 14 | 15 | - replace boolean with bit 16 | - replace false with 0 17 | - replace true with 1 18 | 19 | 20 | -------------------------------------------------------------------------------- /mssql/stackOverflow2020/README.md: -------------------------------------------------------------------------------- 1 | # Stack Overflow SQL Server Database - 2020-06 Version 2 | 3 | For more information and the latest release: 4 | https://www.brentozar.com/go/querystack 5 | 6 | Imported from the Stack Exchange Data Dump as of June 2020: 7 | https://archive.org/details/stackexchange 8 | 9 | Imported using the Stack Overflow Data Dump Importer: 10 | https://github.com/BrentOzarULTD/soddi 11 | 12 | This database is in Microsoft SQL Server 2008 format, which means you can 13 | attach it to any SQL Server 2008 or newer instance. 14 | 15 | To keep the size small but let you get started fast: 16 | 17 | * All tables have a clustered index 18 | * No nonclustered or full text indexes are included 19 | * The log file is small, and you should grow it out if you plan to modify data 20 | * It's distributed as an mdf/ldf so you don't need space to restore it 21 | * It only includes StackOverflow.com data, not data for other Stack sites 22 | 23 | As with the original data dump, this is provided under cc-by-sa 4.0 license: 24 | https://creativecommons.org/licenses/by-sa/4.0/ 25 | 26 | You are free to share this database and adapt it for any purpose, even 27 | commercially, but you must attribute it to the original authors: 28 | https://archive.org/details/stackexchange -------------------------------------------------------------------------------- /mssql/standup-slack-bot/README.md: -------------------------------------------------------------------------------- 1 | ## standup-slack-bot 2 | 3 | - source: schema from postgres folder in same repo 4 | 5 | ## Modifications to source 6 | 7 | - schema from postgres folder in same repo 8 | - converted using http://www.sqlines.com/online 9 | 10 | - remove extensions and settings 11 | - remove statements containing word OWNER because not recognized by sql server 12 | - remove word ONLY because not recognized by sql server 13 | - remove trigger and trigger functions 14 | - remove occurences of [] 15 | - remove CHECK and ENUM related fields 16 | - remove teams trial_end + 14 days cast in get dates default 17 | - remove nested create index statements inside model 18 | 19 | - replace tempo and convo schema names with dbo 20 | - replace DEFAULT dbo.timezone(cast('utc' as varchar(max)) with getdate() 21 | - replace jsonb with NVARCHAR(255) -------------------------------------------------------------------------------- /mssql/students/README.md: -------------------------------------------------------------------------------- 1 | # students 2 | 3 | - website: http://buildingbettersoftware.blogspot.com/2016/02/sample-database-for-what-every.html 4 | - source: https://drive.google.com/file/d/0B-kpH7AX6Uc5TFlJaEtsbGQwWEE/view 5 | 6 | ## Modifications made to source -------------------------------------------------------------------------------- /mssql/students/schema.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/mssql/students/schema.sql -------------------------------------------------------------------------------- /mysql-v8/prisma-3089/schema.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 8.0.21, for macos10.15 (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: testDB 4 | -- ------------------------------------------------------ 5 | -- Server version 8.0.19 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!50503 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `SampleTable` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `SampleTable`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!50503 SET character_set_client = utf8mb4 */; 25 | CREATE TABLE `SampleTable` ( 26 | `id` int NOT NULL, 27 | `name` varchar(45) DEFAULT NULL, 28 | `parentId` int DEFAULT NULL, 29 | PRIMARY KEY (`id`), 30 | UNIQUE KEY `SampleTableUniqueIndexName` (`name`,(ifnull(`parentId`,-(1)))) 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 32 | /*!40101 SET character_set_client = @saved_cs_client */; 33 | 34 | -- 35 | -- Dumping data for table `SampleTable` 36 | -- 37 | 38 | LOCK TABLES `SampleTable` WRITE; 39 | /*!40000 ALTER TABLE `SampleTable` DISABLE KEYS */; 40 | /*!40000 ALTER TABLE `SampleTable` ENABLE KEYS */; 41 | UNLOCK TABLES; 42 | 43 | -- 44 | -- Dumping routines for database 'testDB' 45 | -- 46 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 47 | 48 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 49 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 50 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 51 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 52 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 53 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 54 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 55 | 56 | -- Dump completed on 2020-08-05 14:46:18 57 | -------------------------------------------------------------------------------- /mysql/README.md: -------------------------------------------------------------------------------- 1 | # MySQL Database Schemas 2 | 3 | ## Sample Database Schemas 4 | 5 | - [Chinook example digital media store](chinook) 6 | - [Northwind demo database](northwind) 7 | - [SportsDB: Open Database Schema for Sports Information](sportsdb) 8 | - [Employees / test_db](employees) 9 | - [Empty](empty) 10 | - [Movielens](moielens) 11 | - [Sakila](sakila) 12 | 13 | ## CMS / Blog 14 | 15 | - [b2evolution](b2evolution) 16 | - [concrete5](concrete5) 17 | - [Contao](contao) 18 | - [Dotclear](dotclear) 19 | - [Drupal](drupal) 20 | - [e107](e107) 21 | - [eZPublish](ezpublish) 22 | - [Joomla!](joomla) 23 | - [MODX Revolution](modx-revolution) 24 | - [MODx](modx) 25 | - [Typo3 (v8)](typo3-v8) 26 | - [Typo3 (v9)](typo3-v9) 27 | - [WBCE](wbce) 28 | - [Wordpress](wordpress) 29 | - [Xoops](xoops) 30 | 31 | ## Forum 32 | 33 | - [FluxBB](fluxbb) 34 | - [MyBB](mybb) 35 | - [phpBB](phpbb) 36 | - [Simple Machines Forun](smf) 37 | - [Vanilla](vanilla) 38 | 39 | ## Image Galleries 40 | 41 | - [Coppermine](coppermine) 42 | - [Koken](koken) 43 | - [Lychee](lychee) 44 | - [Piwigo](piwigo) 45 | - [Zenphoto](zenphoto) 46 | 47 | ## Shop 48 | 49 | - [Cubecart](cubecart) 50 | - [Magento](magento) 51 | - [Opencart](opencart) 52 | - [OSCommerce](oscommerce) 53 | - [PrestaShop](prestashop) 54 | - [Shopware](shopware) 55 | 56 | ## Wiki 57 | 58 | - [MediaWiki](mediawiki) 59 | - [Tiki Wiki](tikiwiki) 60 | - [Wikimedia](wikimedia) 61 | 62 | ## Cloud 63 | 64 | - [FileRun](filerun) 65 | - [Nextcloud](nextcloud) 66 | - [ownCloud](owncloud) 67 | 68 | ## Project Management 69 | 70 | - [collabtive](collabtive) 71 | - [Kanboard](kanboard) 72 | - [Mantis Bug Tracker](mantis) 73 | 74 | ## Other 75 | 76 | - [Dolibarr](dolibarr) 77 | - [elgg](elgg) 78 | - [Form Tools](formtools) 79 | - [Frontaccounting](frontaccounting) 80 | - [Limesurvey](limesourvey) 81 | - [MAP-OS](mapos) 82 | - [Matomo Analytics](matomo) 83 | - [Moodle](moodle) 84 | - [Openclassifieds](openclassifieds) 85 | - [Opendocman](opendocman) 86 | - [OrangeHRM](orangehrm) 87 | - [OSClass](osclass) 88 | - [PHPList](phplist) 89 | - [phpMyChat](phpmychat) 90 | - [phpMyFAQ](phpmyfaq) 91 | - [Simpeg](simpeg) 92 | - [thinkadmin](thinkadmin) 93 | - [worldservantsdoetinchem](worldservantsdoetinchem) 94 | - [YOURLS](yourls) 95 | 96 | ## Unknown 97 | 98 | - [Allsquare](allsquare) 99 | 100 | ## ERDCloud.com exported 101 | 102 | - [CI-Board 3 Pro](ciboard3pro) 103 | - [Gnuboard5](gnuboard5) 104 | - [OKKY](okky) 105 | - [Rido](rido) 106 | - [XpressEngine](xpressengine) 107 | - [Youngcart5](youngcart5) -------------------------------------------------------------------------------- /mysql/allsquare/README.md: -------------------------------------------------------------------------------- 1 | `allsquare.sql` - raw database schema, as received in bug report. 2 | 3 | `allsquare_sanitized.sql` - sanitized, FK relations in correct order, can be re-imported. -------------------------------------------------------------------------------- /mysql/b2evolution/README.md: -------------------------------------------------------------------------------- 1 | # b2evolution 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 6.11.4 6 | - Website: https://b2evolution.net/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/barro-colorado/README.md: -------------------------------------------------------------------------------- 1 | # Barro Colorado 2 | 3 | Schema from Scientific project "Complete data from the Barro Colorado 50-ha plot: 423617 trees, 35 years". 4 | The schema was extracted, see source to get the the 800MB of data. 5 | 6 | ![schema](./schema.png) 7 | 8 | - Version: 10.13 9 | - Source: https://datadryad.org/stash/dataset/doi:10.15146/5xcp-0d46 10 | 11 | License CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license. -------------------------------------------------------------------------------- /mysql/barro-colorado/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/mysql/barro-colorado/schema.png -------------------------------------------------------------------------------- /mysql/chinook/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | https://github.com/lerocha/chinook-database 3 | https://github.com/cwoodruff/ChinookDatabase 4 | 5 | ## ERD 6 | 7 | https://github.com/lerocha/chinook-database/wiki/Chinook-Schema 8 | 9 | ## Modifications made to source 10 | 11 | - Add `AUTO_INCREMENT` (via Chinook_MySql_AutoIncrementPKs.sql) 12 | - Add `ENGINE=InnoDB` 13 | - Remove `DATABASE` and `USE` 14 | - Split data into `data.sql` 15 | 16 | -------------------------------------------------------------------------------- /mysql/ciboard3pro/README.md: -------------------------------------------------------------------------------- 1 | # CI-Board 3 Pro 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: ? 6 | Source: https://www.erdcloud.com/d/wNtbZdTQkjqehzKgn -------------------------------------------------------------------------------- /mysql/collabtive/README.md: -------------------------------------------------------------------------------- 1 | # collabtive 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.1 6 | - Website: http://collabtive.o-dyn.de/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/concrete5/README.md: -------------------------------------------------------------------------------- 1 | # concrete5 CMS 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 8.5.1 6 | - Website: https://www.concrete5.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/contao/README.md: -------------------------------------------------------------------------------- 1 | # Contao CMS 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.5.40 6 | - Website: https://contao.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/coppermine/README.md: -------------------------------------------------------------------------------- 1 | # Coppermine 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.6.06 6 | - Website: https://coppermine-gallery.net/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/cubecart/README.md: -------------------------------------------------------------------------------- 1 | # cubecart 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 6.2.8 6 | - Website: https://www.cubecart.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/dolibarr/README.md: -------------------------------------------------------------------------------- 1 | # dolibarr 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 11.0.0 6 | - Website: https://www.dolibarr.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/dotclear/README.md: -------------------------------------------------------------------------------- 1 | # Dotclear 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.15.3 6 | - Website: https://dotclear.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/drupal/README.md: -------------------------------------------------------------------------------- 1 | # Drupal 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 8.7.8 6 | - Website: https://www.drupal.de/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/e107/README.md: -------------------------------------------------------------------------------- 1 | # e107 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.2.1 6 | - Website: https://e107.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/elgg/README.md: -------------------------------------------------------------------------------- 1 | # Elgg 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.3.14 6 | - Website: https://elgg.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/employees/README.md: -------------------------------------------------------------------------------- 1 | # test_db / employees 2 | 3 | ## Source 4 | https://github.com/datacharmer/test_db 5 | 6 | ## Modifications made to source 7 | * Removed the import of the actual data from `employees.sql` 8 | 9 | -------------------------------------------------------------------------------- /mysql/employees/schema.sql: -------------------------------------------------------------------------------- 1 | -- Sample employee database 2 | -- See changelog table for details 3 | -- Copyright (C) 2007,2008, MySQL AB 4 | -- 5 | -- Original data created by Fusheng Wang and Carlo Zaniolo 6 | -- http://www.cs.aau.dk/TimeCenter/software.htm 7 | -- http://www.cs.aau.dk/TimeCenter/Data/employeeTemporalDataSet.zip 8 | -- 9 | -- Current schema by Giuseppe Maxia 10 | -- Data conversion from XML to relational by Patrick Crews 11 | -- 12 | -- This work is licensed under the 13 | -- Creative Commons Attribution-Share Alike 3.0 Unported License. 14 | -- To view a copy of this license, visit 15 | -- http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to 16 | -- Creative Commons, 171 Second Street, Suite 300, San Francisco, 17 | -- California, 94105, USA. 18 | -- 19 | -- DISCLAIMER 20 | -- To the best of our knowledge, this data is fabricated, and 21 | -- it does not correspond to real people. 22 | -- Any similarity to existing people is purely coincidental. 23 | -- 24 | 25 | DROP DATABASE IF EXISTS employees; 26 | CREATE DATABASE IF NOT EXISTS employees; 27 | USE employees; 28 | 29 | SELECT 'CREATING DATABASE STRUCTURE' as 'INFO'; 30 | 31 | DROP TABLE IF EXISTS dept_emp, 32 | dept_manager, 33 | titles, 34 | salaries, 35 | employees, 36 | departments; 37 | 38 | /*!50503 set default_storage_engine = InnoDB */; 39 | /*!50503 select CONCAT('storage engine: ', @@default_storage_engine) as INFO */; 40 | 41 | CREATE TABLE employees ( 42 | emp_no INT NOT NULL, 43 | birth_date DATE NOT NULL, 44 | first_name VARCHAR(14) NOT NULL, 45 | last_name VARCHAR(16) NOT NULL, 46 | gender ENUM ('M','F') NOT NULL, 47 | hire_date DATE NOT NULL, 48 | PRIMARY KEY (emp_no) 49 | ); 50 | 51 | CREATE TABLE departments ( 52 | dept_no CHAR(4) NOT NULL, 53 | dept_name VARCHAR(40) NOT NULL, 54 | PRIMARY KEY (dept_no), 55 | UNIQUE KEY (dept_name) 56 | ); 57 | 58 | CREATE TABLE dept_manager ( 59 | emp_no INT NOT NULL, 60 | dept_no CHAR(4) NOT NULL, 61 | from_date DATE NOT NULL, 62 | to_date DATE NOT NULL, 63 | FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE, 64 | FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE, 65 | PRIMARY KEY (emp_no,dept_no) 66 | ); 67 | 68 | CREATE TABLE dept_emp ( 69 | emp_no INT NOT NULL, 70 | dept_no CHAR(4) NOT NULL, 71 | from_date DATE NOT NULL, 72 | to_date DATE NOT NULL, 73 | FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE, 74 | FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE, 75 | PRIMARY KEY (emp_no,dept_no) 76 | ); 77 | 78 | CREATE TABLE titles ( 79 | emp_no INT NOT NULL, 80 | title VARCHAR(50) NOT NULL, 81 | from_date DATE NOT NULL, 82 | to_date DATE, 83 | FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE, 84 | PRIMARY KEY (emp_no,title, from_date) 85 | ) 86 | ; 87 | 88 | CREATE TABLE salaries ( 89 | emp_no INT NOT NULL, 90 | salary INT NOT NULL, 91 | from_date DATE NOT NULL, 92 | to_date DATE NOT NULL, 93 | FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE, 94 | PRIMARY KEY (emp_no, from_date) 95 | ) 96 | ; 97 | 98 | CREATE OR REPLACE VIEW dept_emp_latest_date AS 99 | SELECT emp_no, MAX(from_date) AS from_date, MAX(to_date) AS to_date 100 | FROM dept_emp 101 | GROUP BY emp_no; 102 | 103 | # shows only the current department for each employee 104 | CREATE OR REPLACE VIEW current_dept_emp AS 105 | SELECT l.emp_no, dept_no, l.from_date, l.to_date 106 | FROM dept_emp d 107 | INNER JOIN dept_emp_latest_date l 108 | ON d.emp_no=l.emp_no AND d.from_date=l.from_date AND l.to_date = d.to_date; 109 | -------------------------------------------------------------------------------- /mysql/empty/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Empty DB to auto create an empty database when we use a script to load this. 4 | Empty database helps us understand how our tooling works with empty databases. 5 | -------------------------------------------------------------------------------- /mysql/empty/schema.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/mysql/empty/schema.sql -------------------------------------------------------------------------------- /mysql/exo/README.md: -------------------------------------------------------------------------------- 1 | # Exo 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 6.0 6 | - Website: https://www.exoplatform.com/ 7 | - Source: https://hub.docker.com/r/exoplatform/exo-community 8 | -------------------------------------------------------------------------------- /mysql/exo/data.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/mysql/exo/data.sql -------------------------------------------------------------------------------- /mysql/ezpublish/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://ez.no/ 4 | -------------------------------------------------------------------------------- /mysql/filerun/README.md: -------------------------------------------------------------------------------- 1 | # FileRun - File Manager 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2019.06.01 6 | - Website: https://www.filerun.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/fluxbb/README.md: -------------------------------------------------------------------------------- 1 | # fluxbb 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.5.11 6 | - Website: https://fluxbb.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/formtools/README.md: -------------------------------------------------------------------------------- 1 | # Form Tools 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.0.15 6 | - Website: https://formtools.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/frontaccounting/README.md: -------------------------------------------------------------------------------- 1 | # frontaccounting 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.4.7 6 | - Website: https://frontaccounting.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/ghost/README.md: -------------------------------------------------------------------------------- 1 | # Ghost 2 | 3 | Schema dump exported via [docker-compose](https://gist.githubusercontent.com/2color/0768d165a59876dd4873c20e5e0eb53f/raw/ab50a56e172dc3f7c056762465c17d366b204370/ghost_stack.yaml) 4 | 5 | - MySQL Version: 5.7.29 6 | - Ghost version: 3.7.0 7 | - Website: https://ghost.org 8 | -------------------------------------------------------------------------------- /mysql/gnuboard5/README.md: -------------------------------------------------------------------------------- 1 | # GNUBOARD5 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: https://github.com/gnuboard/gnuboard5 6 | Source: https://www.erdcloud.com/d/4uo6t2Sn7J2oA68i9 -------------------------------------------------------------------------------- /mysql/introspection-warning/schema.sql: -------------------------------------------------------------------------------- 1 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 2 | /*!40101 SET NAMES utf8 */; 3 | /*!50503 SET NAMES utf8mb4 */; 4 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 5 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 6 | 7 | CREATE TABLE IF NOT EXISTS `column_name_that_becomes_empty_string` ( 8 | `field1` int(11) NOT NULL AUTO_INCREMENT, 9 | `12345` int(11) DEFAULT NULL, 10 | PRIMARY KEY (`field1`) 11 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 12 | 13 | CREATE TABLE IF NOT EXISTS `invalid_enum_value_name` ( 14 | `field1` int(11) NOT NULL AUTO_INCREMENT, 15 | `here_be_enum` enum('Y','N','123','$§!') DEFAULT NULL, 16 | PRIMARY KEY (`field1`) 17 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 18 | 19 | CREATE TABLE IF NOT EXISTS `no_unique_identifier` ( 20 | `field1` int(11) DEFAULT NULL, 21 | `field2` int(11) DEFAULT NULL 22 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 23 | 24 | CREATE TABLE IF NOT EXISTS `unsupported_type` ( 25 | `field1` int(11) NOT NULL AUTO_INCREMENT, 26 | `unsupported` binary(50) DEFAULT NULL, 27 | PRIMARY KEY (`field1`) 28 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 29 | 30 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; 31 | /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; 32 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 33 | -------------------------------------------------------------------------------- /mysql/jira/README.md: -------------------------------------------------------------------------------- 1 | # Jira 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 712001 6 | - Website: https://www.atlassian.com/software/jira 7 | - Source: https://github.com/JensPiegsa/JIRA 8 | -------------------------------------------------------------------------------- /mysql/joomla/README.md: -------------------------------------------------------------------------------- 1 | # Joomla! 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.9.12 6 | - Website: https://www.joomla.de/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/kanboard/README.md: -------------------------------------------------------------------------------- 1 | # Kanboard 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 1.2.11 6 | - Website: https://kanboard.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/koken/README.md: -------------------------------------------------------------------------------- 1 | # koken 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 0.22.24 6 | - Website: http://koken.me/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/limesurvey/README.md: -------------------------------------------------------------------------------- 1 | # LimeSurvey 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.7.1+180424 6 | - Website: https://www.limesurvey.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/lychee/README.md: -------------------------------------------------------------------------------- 1 | # Lychee Photo Management 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.2.14 6 | - Website: https://lychee.electerious.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/lychee/schema.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.27, for Win64 (x86_64) 2 | -- 3 | -- Host: all-prisma.de Database: d02ff6e7 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.28-nmm1-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `lt5ae_lychee_albums` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `lt5ae_lychee_albums`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `lt5ae_lychee_albums` ( 26 | `id` bigint(14) unsigned NOT NULL, 27 | `title` varchar(100) NOT NULL DEFAULT '', 28 | `description` varchar(1000) DEFAULT '', 29 | `sysstamp` int(11) NOT NULL, 30 | `public` tinyint(1) NOT NULL DEFAULT '0', 31 | `visible` tinyint(1) NOT NULL DEFAULT '1', 32 | `downloadable` tinyint(1) NOT NULL DEFAULT '0', 33 | `password` varchar(100) DEFAULT NULL, 34 | `min_takestamp` int(11) NOT NULL, 35 | `max_takestamp` int(11) NOT NULL, 36 | `license` varchar(20) DEFAULT 'none', 37 | PRIMARY KEY (`id`) 38 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 39 | /*!40101 SET character_set_client = @saved_cs_client */; 40 | 41 | -- 42 | -- Table structure for table `lt5ae_lychee_log` 43 | -- 44 | 45 | DROP TABLE IF EXISTS `lt5ae_lychee_log`; 46 | /*!40101 SET @saved_cs_client = @@character_set_client */; 47 | /*!40101 SET character_set_client = utf8 */; 48 | CREATE TABLE `lt5ae_lychee_log` ( 49 | `id` int(11) NOT NULL AUTO_INCREMENT, 50 | `time` int(11) NOT NULL, 51 | `type` varchar(11) NOT NULL, 52 | `function` varchar(100) NOT NULL, 53 | `line` int(11) NOT NULL, 54 | `text` text, 55 | PRIMARY KEY (`id`) 56 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 57 | /*!40101 SET character_set_client = @saved_cs_client */; 58 | 59 | -- 60 | -- Table structure for table `lt5ae_lychee_photos` 61 | -- 62 | 63 | DROP TABLE IF EXISTS `lt5ae_lychee_photos`; 64 | /*!40101 SET @saved_cs_client = @@character_set_client */; 65 | /*!40101 SET character_set_client = utf8 */; 66 | CREATE TABLE `lt5ae_lychee_photos` ( 67 | `id` bigint(14) unsigned NOT NULL, 68 | `title` varchar(100) NOT NULL DEFAULT '', 69 | `description` varchar(1000) DEFAULT '', 70 | `url` varchar(100) NOT NULL, 71 | `tags` varchar(1000) NOT NULL DEFAULT '', 72 | `public` tinyint(1) NOT NULL, 73 | `type` varchar(15) DEFAULT NULL, 74 | `width` int(11) NOT NULL, 75 | `height` int(11) NOT NULL, 76 | `size` varchar(20) NOT NULL, 77 | `iso` varchar(15) NOT NULL, 78 | `aperture` varchar(20) NOT NULL, 79 | `make` varchar(50) NOT NULL, 80 | `model` varchar(50) NOT NULL, 81 | `lens` varchar(100) NOT NULL DEFAULT '', 82 | `shutter` varchar(30) NOT NULL, 83 | `focal` varchar(20) NOT NULL, 84 | `takestamp` int(11) DEFAULT NULL, 85 | `star` tinyint(1) NOT NULL, 86 | `thumbUrl` char(37) NOT NULL, 87 | `album` bigint(14) unsigned NOT NULL, 88 | `checksum` char(40) DEFAULT NULL, 89 | `medium` tinyint(1) NOT NULL DEFAULT '0', 90 | `small` tinyint(1) NOT NULL DEFAULT '0', 91 | `license` varchar(20) NOT NULL DEFAULT 'none', 92 | PRIMARY KEY (`id`), 93 | KEY `Index_album` (`album`), 94 | KEY `Index_star` (`star`) 95 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 96 | /*!40101 SET character_set_client = @saved_cs_client */; 97 | 98 | -- 99 | -- Table structure for table `lt5ae_lychee_settings` 100 | -- 101 | 102 | DROP TABLE IF EXISTS `lt5ae_lychee_settings`; 103 | /*!40101 SET @saved_cs_client = @@character_set_client */; 104 | /*!40101 SET character_set_client = utf8 */; 105 | CREATE TABLE `lt5ae_lychee_settings` ( 106 | `key` varchar(50) NOT NULL DEFAULT '', 107 | `value` varchar(200) DEFAULT '', 108 | PRIMARY KEY (`key`) 109 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 110 | /*!40101 SET character_set_client = @saved_cs_client */; 111 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 112 | 113 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 114 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 115 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 116 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 117 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 118 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 119 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 120 | 121 | -- Dump completed on 2020-02-07 13:36:23 122 | -------------------------------------------------------------------------------- /mysql/magento/README.md: -------------------------------------------------------------------------------- 1 | # Magento 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2.3.2 6 | - Website: https://www.magento.com 7 | - Source: https://magento.com/tech-resources/download 8 | -------------------------------------------------------------------------------- /mysql/mantis/README.md: -------------------------------------------------------------------------------- 1 | # mantis Bug Tracker 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2.22.1 6 | - Website: https://www.mantisbt.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/mapos/README.md: -------------------------------------------------------------------------------- 1 | # MAP-OS 2 | 3 | From: https://github.com/RamonSilva20/mapos 4 | -------------------------------------------------------------------------------- /mysql/matomo/README.md: -------------------------------------------------------------------------------- 1 | # Matomo Analytics 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.11.0 6 | - Website: https://matomo.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/mediawiki/README.md: -------------------------------------------------------------------------------- 1 | # MediaWiki 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 1.33.0 6 | - Website: https://www.mediawiki.org/wiki/MediaWiki 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/modx-revolution/README.md: -------------------------------------------------------------------------------- 1 | # MODX Revolution 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2.7.1 6 | - Website: http://modx.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/modx/README.md: -------------------------------------------------------------------------------- 1 | # MODx 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.5.5-pl 6 | - Website: https://modx.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/moodle/README.md: -------------------------------------------------------------------------------- 1 | # Moodle 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.5.6 6 | - Website: https://moodle.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/movielens/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://github.com/ankane/movielens.sql 4 | -------------------------------------------------------------------------------- /mysql/movielens/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------- 2 | -- TablePlus 2.12(282) 3 | -- 4 | -- https://tableplus.com/ 5 | -- 6 | -- Database: movielens 7 | -- Generation Time: 2019-12-27 01:18:54.9610 8 | -- ------------------------------------------------------------- 9 | 10 | 11 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 12 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 13 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 14 | /*!40101 SET NAMES utf8 */; 15 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 16 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 17 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 18 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 19 | 20 | 21 | CREATE TABLE `genres` ( 22 | `id` int(11) NOT NULL, 23 | `name` varchar(255) DEFAULT NULL, 24 | PRIMARY KEY (`id`) 25 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 26 | 27 | CREATE TABLE `genres_movies` ( 28 | `id` int(11) NOT NULL, 29 | `movie_id` int(11) DEFAULT NULL, 30 | `genre_id` int(11) DEFAULT NULL, 31 | PRIMARY KEY (`id`) 32 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 33 | 34 | CREATE TABLE `movies` ( 35 | `id` int(11) NOT NULL, 36 | `title` varchar(255) DEFAULT NULL, 37 | `release_date` date DEFAULT NULL, 38 | PRIMARY KEY (`id`) 39 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 40 | 41 | CREATE TABLE `occupations` ( 42 | `id` int(11) NOT NULL, 43 | `name` varchar(255) DEFAULT NULL, 44 | PRIMARY KEY (`id`) 45 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 46 | 47 | CREATE TABLE `ratings` ( 48 | `id` int(11) NOT NULL, 49 | `user_id` int(11) DEFAULT NULL, 50 | `movie_id` int(11) DEFAULT NULL, 51 | `rating` int(11) DEFAULT NULL, 52 | `rated_at` timestamp NULL DEFAULT NULL, 53 | PRIMARY KEY (`id`) 54 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 55 | 56 | CREATE TABLE `users` ( 57 | `id` int(11) NOT NULL, 58 | `age` int(11) DEFAULT NULL, 59 | `gender` char(1) DEFAULT NULL, 60 | `occupation_id` int(11) DEFAULT NULL, 61 | `zip_code` varchar(255) DEFAULT NULL, 62 | PRIMARY KEY (`id`) 63 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 64 | 65 | 66 | 67 | 68 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 69 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 70 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 71 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 72 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 73 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 74 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -------------------------------------------------------------------------------- /mysql/mybb/README.md: -------------------------------------------------------------------------------- 1 | # MyBB 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 1.8.21 6 | - Website: https://mybb.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/nextcloud/README.md: -------------------------------------------------------------------------------- 1 | # Nextcloud 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 17.0.0 6 | - Website: https://nextcloud.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/northwind/README.md: -------------------------------------------------------------------------------- 1 | # Northwind 2 | 3 | ## Source 4 | https://github.com/dalers/mywind 5 | 6 | ## Modifications made to source 7 | * Fix beginning of script to use `CREATE DATABASE` instead of `CREATE SCHEMA` in `northwind.sql` 8 | 9 | -------------------------------------------------------------------------------- /mysql/okky/README.md: -------------------------------------------------------------------------------- 1 | # OKKY 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: https://okky.kr/ + https://github.com/okjsp/okky 6 | Source: https://www.erdcloud.com/d/PK2Ae7d4asTRqHpHx -------------------------------------------------------------------------------- /mysql/opencart/README.md: -------------------------------------------------------------------------------- 1 | # OpenCart 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.0.3.2 6 | - Website: https://www.opencart.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/openclassifieds/README.md: -------------------------------------------------------------------------------- 1 | # Openclassifieds / Yclas 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.3.0 6 | - Website: https://github.com/yclas/yclas 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/opendocman/README.md: -------------------------------------------------------------------------------- 1 | # Opendocman 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.3.5 6 | - Website: https://www.opendocman.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/orangehrm/README.md: -------------------------------------------------------------------------------- 1 | # orangehrm 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 4.0 6 | - Website: https://www.orangehrm.com/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/osclass/README.md: -------------------------------------------------------------------------------- 1 | # osclass 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.8.0 6 | - Website: https://github.com/osclass/Osclass 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/oscommerce/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://www.oscommerce.com/ 4 | -------------------------------------------------------------------------------- /mysql/owncloud/README.md: -------------------------------------------------------------------------------- 1 | # ownCloud 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 10.2.1 6 | - Website: https://owncloud.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/phpbb/README.md: -------------------------------------------------------------------------------- 1 | # phpBB 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.2.8 6 | - Website: https://www.phpbb.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/phplist/README.md: -------------------------------------------------------------------------------- 1 | # phpList 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 3.5.1 6 | - Website: https://www.phplist.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/phpmychat/README.md: -------------------------------------------------------------------------------- 1 | # phpmychat 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.98 6 | - Website: https://sourceforge.net/projects/phpmychat/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/phpmyfaq/README.md: -------------------------------------------------------------------------------- 1 | # phpMyFAQ 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2.9.13 6 | - Website: https://www.phpmyfaq.de/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/piwigo/README.md: -------------------------------------------------------------------------------- 1 | # Piwigo 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 2.9.5 6 | - Website: https://piwigo.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/prestashop/README.md: -------------------------------------------------------------------------------- 1 | # PrestaShop 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 1.7.6.1 6 | - Website: https://www.prestashop.com 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/rido/README.md: -------------------------------------------------------------------------------- 1 | # Rido 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: ? 6 | Source: https://www.erdcloud.com/d/qagoB8w56fgeYEL5Q -------------------------------------------------------------------------------- /mysql/sakila/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://dev.mysql.com/doc/sakila/en/ 4 | -------------------------------------------------------------------------------- /mysql/shopware/README.md: -------------------------------------------------------------------------------- 1 | # Shopware 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 5.6.2 6 | - Website: https://www.shopware.com/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/simpeg/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://github.com/gedelumbung/simpeg 4 | -------------------------------------------------------------------------------- /mysql/smf/README.md: -------------------------------------------------------------------------------- 1 | # SMF 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.0.17 6 | - Website: https://simplemachines.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/sportsdb/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | http://www.sportsdb.org/sd/samples 3 | https://docs.yugabyte.com/latest/sample-data/sportsdb/#about-the-sportsdb-sample-database 4 | 5 | ## Modifications made to source 6 | * Removed DB create, user 7 | 8 | 9 | -------------------------------------------------------------------------------- /mysql/thinkadmin/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://github.com/zoujingli/ThinkAdmin 4 | -------------------------------------------------------------------------------- /mysql/tikiwiki/README.md: -------------------------------------------------------------------------------- 1 | # Tiki Wiki 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 20.0 6 | - Website: https://tiki.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/typo3-v8/README.md: -------------------------------------------------------------------------------- 1 | # TYPO3 CMS (v8) 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 8.7.28 6 | - Website: https://typo3.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/typo3-v9/README.md: -------------------------------------------------------------------------------- 1 | # TYPO3 CMS (v9) 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 9.5.10 6 | - Website: https://typo3.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/vanilla/README.md: -------------------------------------------------------------------------------- 1 | # Vanilla Forums 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 3.1 6 | - Website: https://vanillaforums.com/en/software/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/wbce/README.md: -------------------------------------------------------------------------------- 1 | # WBCE CMS 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 1.4.0 6 | - Website: https://wbce.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/wikimedia/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://meta.wikimedia.org/wiki/Data_dumps/What%27s_available_for_download 4 | -------------------------------------------------------------------------------- /mysql/wordpress/README.md: -------------------------------------------------------------------------------- 1 | # Wordpress CMS 2 | 3 | Schema only dump exported via phpMyAdmin 4 | 5 | - Version: 5.2.1 6 | - Website: https://wordpress.org/ 7 | - Source: https://all-inkl.com/webhosting/software-installer/ 8 | -------------------------------------------------------------------------------- /mysql/worldservantsdoetinchem/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: http://www.worldservantsdoetinchem.nl/ 4 | -------------------------------------------------------------------------------- /mysql/xoops/README.md: -------------------------------------------------------------------------------- 1 | # XOOPS 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 2.5.9 6 | - Website: https://xoops.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/xpressengine/README.md: -------------------------------------------------------------------------------- 1 | # XpressEngine 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: https://www.xpressengine.com/ + https://github.com/xpressengine/xpressengine 6 | Source: https://www.erdcloud.com/d/fqvPonSme7tBDq9Dj -------------------------------------------------------------------------------- /mysql/youngcart5/README.md: -------------------------------------------------------------------------------- 1 | # Youngcart5 2 | 3 | Schema only dump exported via erdcloud.com 4 | 5 | Website: https://github.com/gnuboard/youngcart5 6 | Source: https://www.erdcloud.com/d/mtCwZPhavZD6ZSdtA -------------------------------------------------------------------------------- /mysql/yourls/README.md: -------------------------------------------------------------------------------- 1 | # YOURLS 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.7.6 6 | - Website: https://yourls.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql/yourls/data.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.5.62, for debian-linux-gnu (x86_64) 2 | -- 3 | -- Host: db816440005.hosting-data.io Database: db816440005 4 | -- ------------------------------------------------------ 5 | -- Server version 5.5.60-0+deb7u1-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Dumping data for table `your_log` 20 | -- 21 | 22 | LOCK TABLES `your_log` WRITE; 23 | /*!40000 ALTER TABLE `your_log` DISABLE KEYS */; 24 | /*!40000 ALTER TABLE `your_log` ENABLE KEYS */; 25 | UNLOCK TABLES; 26 | 27 | -- 28 | -- Dumping data for table `your_options` 29 | -- 30 | 31 | LOCK TABLES `your_options` WRITE; 32 | /*!40000 ALTER TABLE `your_options` DISABLE KEYS */; 33 | INSERT INTO `your_options` VALUES (1,'version','1.7.6'),(2,'db_version','482'),(3,'next_id','1'),(4,'active_plugins','a:0:{}'); 34 | /*!40000 ALTER TABLE `your_options` ENABLE KEYS */; 35 | UNLOCK TABLES; 36 | 37 | -- 38 | -- Dumping data for table `your_url` 39 | -- 40 | 41 | LOCK TABLES `your_url` WRITE; 42 | /*!40000 ALTER TABLE `your_url` DISABLE KEYS */; 43 | INSERT INTO `your_url` VALUES ('yourlsblog','http://blog.yourls.org/','YOURLS\' Blog','2020-02-09 17:30:45','10.72.23.72',0),('yourls','http://yourls.org/','YOURLS: Your Own URL Shortener','2020-02-09 17:30:45','10.72.23.72',0),('ozh','http://ozh.org/','ozh.org','2020-02-09 17:30:45','10.72.23.72',0); 44 | /*!40000 ALTER TABLE `your_url` ENABLE KEYS */; 45 | UNLOCK TABLES; 46 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 47 | 48 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 49 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 50 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 51 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 52 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 53 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 54 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 55 | 56 | -- Dump completed on 2020-02-10 19:28:58 57 | -------------------------------------------------------------------------------- /mysql/yourls/schema.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.5.62, for debian-linux-gnu (x86_64) 2 | -- 3 | -- Host: db816440005.hosting-data.io Database: db816440005 4 | -- ------------------------------------------------------ 5 | -- Server version 5.5.60-0+deb7u1-log 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `your_log` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `your_log`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `your_log` ( 26 | `click_id` int(11) NOT NULL AUTO_INCREMENT, 27 | `click_time` datetime NOT NULL, 28 | `shorturl` varchar(200) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, 29 | `referrer` varchar(200) COLLATE latin1_german2_ci NOT NULL, 30 | `user_agent` varchar(255) COLLATE latin1_german2_ci NOT NULL, 31 | `ip_address` varchar(41) COLLATE latin1_german2_ci NOT NULL, 32 | `country_code` char(2) COLLATE latin1_german2_ci NOT NULL, 33 | PRIMARY KEY (`click_id`), 34 | KEY `shorturl` (`shorturl`) 35 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; 36 | /*!40101 SET character_set_client = @saved_cs_client */; 37 | 38 | -- 39 | -- Table structure for table `your_options` 40 | -- 41 | 42 | DROP TABLE IF EXISTS `your_options`; 43 | /*!40101 SET @saved_cs_client = @@character_set_client */; 44 | /*!40101 SET character_set_client = utf8 */; 45 | CREATE TABLE `your_options` ( 46 | `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 47 | `option_name` varchar(64) COLLATE latin1_german2_ci NOT NULL DEFAULT '', 48 | `option_value` longtext COLLATE latin1_german2_ci NOT NULL, 49 | PRIMARY KEY (`option_id`,`option_name`), 50 | KEY `option_name` (`option_name`) 51 | ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; 52 | /*!40101 SET character_set_client = @saved_cs_client */; 53 | 54 | -- 55 | -- Table structure for table `your_url` 56 | -- 57 | 58 | DROP TABLE IF EXISTS `your_url`; 59 | /*!40101 SET @saved_cs_client = @@character_set_client */; 60 | /*!40101 SET character_set_client = utf8 */; 61 | CREATE TABLE `your_url` ( 62 | `keyword` varchar(200) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, 63 | `url` text CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, 64 | `title` text CHARACTER SET utf8, 65 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 66 | `ip` varchar(41) COLLATE latin1_german2_ci NOT NULL, 67 | `clicks` int(10) unsigned NOT NULL, 68 | PRIMARY KEY (`keyword`), 69 | KEY `timestamp` (`timestamp`), 70 | KEY `ip` (`ip`) 71 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci; 72 | /*!40101 SET character_set_client = @saved_cs_client */; 73 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 74 | 75 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 76 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 77 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 78 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 79 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 80 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 81 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 82 | 83 | -- Dump completed on 2020-02-10 18:20:19 84 | -------------------------------------------------------------------------------- /mysql/zencart/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://www.zen-cart.com/ 4 | -------------------------------------------------------------------------------- /mysql/zenphoto/README.md: -------------------------------------------------------------------------------- 1 | # ZenPhoto 2 | 3 | Schema only dump exported via `mysqldump` 4 | 5 | - Version: 1.5.6 6 | - Website: https://www.zenphoto.org/ 7 | - Source: https://www.ionos.de/hilfe/websites-e-shops/click-build-anwendungen/haeufige-fragen-zu-click-build/ 8 | -------------------------------------------------------------------------------- /mysql_academic/mysql_127/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://relational.fit.cvut.cz/ 4 | Note: this is available in its own database server and not public MySQL. 5 | -------------------------------------------------------------------------------- /postgres/aragon-notification-service/README.md: -------------------------------------------------------------------------------- 1 | # Aragon Notification Service 2 | 3 | Schema based on https://github.com/aragonone/notification-service 4 | -------------------------------------------------------------------------------- /postgres/basic-blog/Readme.md: -------------------------------------------------------------------------------- 1 | # Basic blog example 2 | 3 | ```groovy 4 | model Blog { 5 | id: Int @id 6 | name: String 7 | viewCount: Int 8 | posts: Post[] 9 | authors: Author[] 10 | } 11 | 12 | model Author { 13 | id: Int @id 14 | name: String? 15 | authors: Blog[] 16 | } 17 | 18 | model Post { 19 | id: Int @id 20 | title: String 21 | tags: String[] 22 | blog: Blog 23 | } 24 | ``` 25 | -------------------------------------------------------------------------------- /postgres/basic-blog/datamodel-1.0.groovy: -------------------------------------------------------------------------------- 1 | type Author @pgTable(name: "authors") { 2 | authorsBlogs: [AuthorsBlog] 3 | id: Int! @unique 4 | name: String 5 | } 6 | 7 | type AuthorsBlog @linkTable @pgTable(name: "authors_blogs") { 8 | author: Author! @pgColumn(name: "author_id") 9 | blog: Blog! @pgColumn(name: "blog_id") 10 | } 11 | 12 | type Blog @pgTable(name: "blogs") { 13 | authorsBlogs: [AuthorsBlog] 14 | id: Int! @unique 15 | name: String! 16 | posts: [Post] 17 | viewcount: Int! 18 | } 19 | 20 | type Post @pgTable(name: "posts") { 21 | blog: Blog! @pgColumn(name: "blog_id") 22 | id: Int! @unique 23 | tags: String! @default(value: "{}") 24 | title: String! 25 | } 26 | -------------------------------------------------------------------------------- /postgres/basic-blog/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Author @db(name: "authors") { 2 | authorsBlogs: [AuthorsBlog] 3 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "authors_id_seq", initialValue: 1, allocationSize: 1) 4 | name: String 5 | } 6 | 7 | type AuthorsBlog @db(name: "authors_blogs") @linkTable { 8 | author: Author! @db(name: "author_id") 9 | blog: Blog! @db(name: "blog_id") 10 | } 11 | 12 | type Blog @db(name: "blogs") { 13 | authorsBlogs: [AuthorsBlog] 14 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "blogs_id_seq", initialValue: 1, allocationSize: 1) 15 | name: String! 16 | posts: [Post] 17 | viewcount: Int! 18 | } 19 | 20 | type Post @db(name: "posts") { 21 | blog: Blog! @db(name: "blog_id") 22 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "posts_id_seq", initialValue: 1, allocationSize: 1) 23 | tags: String! @default(value: "{}") 24 | title: String! 25 | } 26 | -------------------------------------------------------------------------------- /postgres/basic-blog/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Author { 2 | id: Int @id @pg.serial("authors_id_seq") 3 | authorsBlogs: AuthorsBlog[] 4 | name: String? 5 | } 6 | 7 | model AuthorBlog { 8 | author: Author 9 | blog: Blog 10 | } 11 | 12 | model Blog { 13 | id: Int @id @pg.serial("blogs_id_seq") 14 | authorsBlogs: AuthorsBlog[] 15 | name: String 16 | posts: Post[] 17 | viewcount: Int 18 | } 19 | 20 | model Post { 21 | id: Int @id @pg.serial("posts_id_seq") 22 | blog: Blog 23 | tags: String @default([]) 24 | title: String 25 | } 26 | -------------------------------------------------------------------------------- /postgres/basic-blog/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Author { 2 | id: Int @id @pg.serial("authors_id_seq") 3 | authorsBlogs: AuthorsBlog[] 4 | name: String? 5 | } 6 | 7 | model AuthorBlog { 8 | author: Author 9 | blog: Blog 10 | } 11 | 12 | model Blog { 13 | id: Int @id @pg.serial("blogs_id_seq") 14 | authorsBlogs: AuthorsBlog[] 15 | name: String 16 | posts: Post[] 17 | viewcount: Int 18 | } 19 | 20 | model Post { 21 | id: Int @id @pg.serial("posts_id_seq") 22 | blog: Blog 23 | tags: String @default([]) 24 | title: String 25 | } 26 | -------------------------------------------------------------------------------- /postgres/basic-blog/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Author { 2 | id Int @id @pg.serial("authors_id_seq") 3 | authorsBlogs AuthorsBlog[] 4 | name String? 5 | } 6 | 7 | model AuthorBlog { 8 | author Author 9 | blog Blog 10 | } 11 | 12 | model Blog { 13 | id Int @id @pg.serial("blogs_id_seq") 14 | authorsBlogs AuthorsBlog[] 15 | name String 16 | posts Post[] 17 | viewcount Int 18 | } 19 | 20 | model Post { 21 | id Int @id @pg.serial("posts_id_seq") 22 | blog Blog 23 | tags String @default([]) 24 | title String 25 | } 26 | -------------------------------------------------------------------------------- /postgres/basic-blog/schema.sql: -------------------------------------------------------------------------------- 1 | create table if not exists blogs ( 2 | id serial not null primary key, 3 | name text not null, 4 | viewCount int not null 5 | ); 6 | 7 | create table if not exists authors ( 8 | id serial primary key not null, 9 | "name" text 10 | ); 11 | 12 | create table if not exists authors_blogs ( 13 | author_id int not null references authors(id) on delete cascade, 14 | blog_id int not null references blogs(id) on delete cascade, 15 | unique(author_id, blog_id) 16 | ); 17 | 18 | create table if not exists posts ( 19 | id serial not null primary key, 20 | blog_id int not null references blogs(id) on delete cascade, 21 | title text not null, 22 | tags text[] not null default '{}' 23 | ); -------------------------------------------------------------------------------- /postgres/basic-twitter/Readme.md: -------------------------------------------------------------------------------- 1 | # Basic Twitter 2 | 3 | Based on Prisma's 4 | [example](https://www.prisma.io/docs/datamodel-and-migrations/datamodel-MONGO-knun/). 5 | 6 | ``` 7 | type Tweet { 8 | id: ID! @id 9 | createdAt: DateTime! @createdAt 10 | text: String! 11 | owner: User! 12 | location: Location! 13 | } 14 | 15 | type User { 16 | id: ID! @id 17 | createdAt: DateTime! @createdAt 18 | updatedAt: DateTime! @updatedAt 19 | handle: String! @unique 20 | name: String 21 | tweets: [Tweet!]! @relation(link: INLINE) 22 | } 23 | 24 | type Location @embedded { 25 | latitude: Float! 26 | longitude: Float! 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /postgres/basic-twitter/datamodel-1.0.groovy: -------------------------------------------------------------------------------- 1 | type Location @pgTable(name: "locations") { 2 | id: UUID! @unique 3 | latitude: Float! 4 | longitude: Float! 5 | tweets: [Tweet] 6 | } 7 | 8 | type Tweet @pgTable(name: "tweets") { 9 | createdAt: DateTime! @pgColumn(name: "created_at") 10 | id: UUID! @unique 11 | location: Location! 12 | owner: User! 13 | text: String! 14 | } 15 | 16 | type User @pgTable(name: "users") { 17 | createdAt: DateTime! @pgColumn(name: "created_at") 18 | handle: String! 19 | id: UUID! @unique 20 | name: String! 21 | tweets: [Tweet] 22 | updatedAt: DateTime! @pgColumn(name: "updated_at") 23 | } 24 | -------------------------------------------------------------------------------- /postgres/basic-twitter/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Location @db(name: "locations") { 2 | id: UUID! @id 3 | latitude: Float! 4 | longitude: Float! 5 | tweets: [Tweet] 6 | } 7 | 8 | type Tweet @db(name: "tweets") { 9 | createdAt: DateTime! @db(name: "created_at") 10 | id: UUID! @id 11 | location: Location! 12 | owner: User! 13 | text: String! 14 | } 15 | 16 | type User @db(name: "users") { 17 | createdAt: DateTime! @db(name: "created_at") 18 | handle: String! 19 | id: UUID! @id 20 | name: String! 21 | tweets: [Tweet] 22 | updatedAt: DateTime! @db(name: "updated_at") 23 | } 24 | -------------------------------------------------------------------------------- /postgres/basic-twitter/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Location { 2 | id: Uuid @id 3 | latitude: Float 4 | longitude: Float 5 | tweets: Tweet[] 6 | } 7 | 8 | model Tweet { 9 | id: Uuid @id 10 | createdAt: DateTime 11 | location: Location 12 | owner: User 13 | text: String 14 | } 15 | 16 | model User { 17 | id: Uuid @id 18 | createdAt: DateTime 19 | handle: String 20 | name: String 21 | tweets: Tweet[] 22 | updatedAt: DateTime 23 | } 24 | -------------------------------------------------------------------------------- /postgres/basic-twitter/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Location { 2 | id: Uuid @id 3 | latitude: Float 4 | longitude: Float 5 | tweets: Tweet[] 6 | } 7 | 8 | model Tweet { 9 | id: Uuid @id 10 | createdAt: DateTime 11 | location: Location 12 | owner: User 13 | text: String 14 | } 15 | 16 | model User { 17 | id: Uuid @id 18 | createdAt: DateTime 19 | handle: String 20 | name: String 21 | tweets: Tweet[] 22 | updatedAt: DateTime 23 | } 24 | -------------------------------------------------------------------------------- /postgres/basic-twitter/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Location { 2 | id Uuid @id 3 | latitude Float 4 | longitude Float 5 | tweets Tweet[] 6 | } 7 | 8 | model Tweet { 9 | id Uuid @id 10 | createdAt DateTime 11 | location Location 12 | owner User 13 | text String 14 | } 15 | 16 | model User { 17 | id Uuid @id 18 | createdAt DateTime 19 | handle String 20 | name String 21 | tweets Tweet[] 22 | updatedAt DateTime 23 | } 24 | -------------------------------------------------------------------------------- /postgres/basic-twitter/schema.sql: -------------------------------------------------------------------------------- 1 | create extension if not exists "pgcrypto"; 2 | 3 | create or replace function set_updated_at() RETURNS trigger 4 | LANGUAGE plpgsql 5 | AS $$ 6 | begin 7 | new.updated_at := current_timestamp; 8 | return new; 9 | end; 10 | $$; 11 | 12 | create table if not exists users ( 13 | id uuid primary key not null default gen_random_uuid(), 14 | "name" text not null, 15 | handle text not null, 16 | created_at timestamp not null default now(), 17 | updated_at timestamp not null default now() 18 | ); 19 | create trigger updated_at before update on users for each row execute procedure set_updated_at(); 20 | 21 | create table if not exists locations ( 22 | id uuid primary key not null default gen_random_uuid(), 23 | latitude float not null, 24 | longitude float not null 25 | ); 26 | 27 | create table if not exists tweets ( 28 | id uuid primary key not null default gen_random_uuid(), 29 | created_at timestamp not null default now(), 30 | "text" text not null, 31 | "owner" uuid not null references users(id) on delete cascade, 32 | "location" uuid not null references locations(id) on delete cascade 33 | ); 34 | -------------------------------------------------------------------------------- /postgres/canvas-lms/README.md: -------------------------------------------------------------------------------- 1 | # Canvas LMS 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: release/2020-02-12.07 6 | - Website: https://github.com/instructure/canvas-lms 7 | - Source: https://github.com/instructure/canvas-lms/wiki/Production-Start 8 | 9 | Note: This was not so easy to setup, I had all sorts of version conflicts. Use the exact versions node and ruby mentioned in the guides. 10 | -------------------------------------------------------------------------------- /postgres/chinook/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | https://github.com/lerocha/chinook-database 3 | 4 | ## Modifications made to source 5 | * None 6 | 7 | -------------------------------------------------------------------------------- /postgres/chinook/datamodel-1.0.groovy: -------------------------------------------------------------------------------- 1 | type Album { 2 | id: Int! @pgColumn(name: "AlbumId") @unique 3 | artistId: Artist! @pgColumn(name: "ArtistId") 4 | title: String! @pgColumn(name: "Title") 5 | track: [Track] 6 | } 7 | 8 | type Artist { 9 | album: [Album] 10 | id: Int! @pgColumn(name: "ArtistId") @unique 11 | name: String @pgColumn(name: "Name") 12 | } 13 | 14 | type Customer { 15 | address: String @pgColumn(name: "Address") 16 | city: String @pgColumn(name: "City") 17 | company: String @pgColumn(name: "Company") 18 | country: String @pgColumn(name: "Country") 19 | id: Int! @pgColumn(name: "CustomerId") @unique 20 | email: String! @pgColumn(name: "Email") 21 | fax: String @pgColumn(name: "Fax") 22 | firstName: String! @pgColumn(name: "FirstName") 23 | invoice: [Invoice] 24 | lastName: String! @pgColumn(name: "LastName") 25 | phone: String @pgColumn(name: "Phone") 26 | postalCode: String @pgColumn(name: "PostalCode") 27 | state: String @pgColumn(name: "State") 28 | supportRepId: Employee @pgColumn(name: "SupportRepId") 29 | } 30 | 31 | type Employee { 32 | address: String @pgColumn(name: "Address") 33 | birthDate: DateTime @pgColumn(name: "BirthDate") 34 | city: String @pgColumn(name: "City") 35 | country: String @pgColumn(name: "Country") 36 | customer: [Customer] 37 | email: String @pgColumn(name: "Email") 38 | employee: [Employee] 39 | id: Int! @pgColumn(name: "EmployeeId") @unique 40 | fax: String @pgColumn(name: "Fax") 41 | firstName: String! @pgColumn(name: "FirstName") 42 | hireDate: DateTime @pgColumn(name: "HireDate") 43 | lastName: String! @pgColumn(name: "LastName") 44 | phone: String @pgColumn(name: "Phone") 45 | postalCode: String @pgColumn(name: "PostalCode") 46 | reportsTo: Employee @pgColumn(name: "ReportsTo") 47 | state: String @pgColumn(name: "State") 48 | title: String @pgColumn(name: "Title") 49 | } 50 | 51 | type Genre { 52 | id: Int! @pgColumn(name: "GenreId") @unique 53 | name: String @pgColumn(name: "Name") 54 | track: [Track] 55 | } 56 | 57 | type Invoice { 58 | billingAddress: String @pgColumn(name: "BillingAddress") 59 | billingCity: String @pgColumn(name: "BillingCity") 60 | billingCountry: String @pgColumn(name: "BillingCountry") 61 | billingPostalCode: String @pgColumn(name: "BillingPostalCode") 62 | billingState: String @pgColumn(name: "BillingState") 63 | customerId: Customer! @pgColumn(name: "CustomerId") 64 | invoiceDate: DateTime! @pgColumn(name: "InvoiceDate") 65 | id: Int! @pgColumn(name: "InvoiceId") @unique 66 | invoiceLine: [InvoiceLine] 67 | total: Float! @pgColumn(name: "Total") 68 | } 69 | 70 | type InvoiceLine { 71 | invoiceId: Invoice! @pgColumn(name: "InvoiceId") 72 | id: Int! @pgColumn(name: "InvoiceLineId") @unique 73 | quantity: Int! @pgColumn(name: "Quantity") 74 | trackId: Track! @pgColumn(name: "TrackId") 75 | unitPrice: Float! @pgColumn(name: "UnitPrice") 76 | } 77 | 78 | type MediaType { 79 | id: Int! @pgColumn(name: "MediaTypeId") @unique 80 | name: String @pgColumn(name: "Name") 81 | track: [Track] 82 | } 83 | 84 | type Playlist { 85 | name: String @pgColumn(name: "Name") 86 | id: Int! @pgColumn(name: "PlaylistId") @unique 87 | playlistTrack: [PlaylistTrack] 88 | } 89 | 90 | type PlaylistTrack @linkTable { 91 | playlistId: Playlist! @pgColumn(name: "PlaylistId") 92 | trackId: Track! @pgColumn(name: "TrackId") 93 | } 94 | 95 | type Track { 96 | albumId: Album @pgColumn(name: "AlbumId") 97 | bytes: Int @pgColumn(name: "Bytes") 98 | composer: String @pgColumn(name: "Composer") 99 | genreId: Genre @pgColumn(name: "GenreId") 100 | invoiceLine: [InvoiceLine] 101 | mediaTypeId: MediaType! @pgColumn(name: "MediaTypeId") 102 | milliseconds: Int! @pgColumn(name: "Milliseconds") 103 | name: String! @pgColumn(name: "Name") 104 | playlistTrack: [PlaylistTrack] 105 | id: Int! @pgColumn(name: "TrackId") @unique 106 | unitPrice: Float! @pgColumn(name: "UnitPrice") 107 | } 108 | -------------------------------------------------------------------------------- /postgres/chinook/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Album { 2 | AlbumId: Int! @id 3 | artistId: Artist! @db(name: "ArtistId") 4 | title: String! @db(name: "Title") 5 | track: [Track] 6 | } 7 | 8 | type Artist { 9 | album: [Album] 10 | ArtistId: Int! @id 11 | name: String @db(name: "Name") 12 | } 13 | 14 | type Customer { 15 | address: String @db(name: "Address") 16 | city: String @db(name: "City") 17 | company: String @db(name: "Company") 18 | country: String @db(name: "Country") 19 | CustomerId: Int! @id 20 | email: String! @db(name: "Email") 21 | fax: String @db(name: "Fax") 22 | firstName: String! @db(name: "FirstName") 23 | invoice: [Invoice] 24 | lastName: String! @db(name: "LastName") 25 | phone: String @db(name: "Phone") 26 | postalCode: String @db(name: "PostalCode") 27 | state: String @db(name: "State") 28 | supportRepId: Employee @db(name: "SupportRepId") 29 | } 30 | 31 | type Employee { 32 | address: String @db(name: "Address") 33 | birthDate: DateTime @db(name: "BirthDate") 34 | city: String @db(name: "City") 35 | country: String @db(name: "Country") 36 | customer: [Customer] 37 | email: String @db(name: "Email") 38 | employee: [Employee] 39 | EmployeeId: Int! @id 40 | fax: String @db(name: "Fax") 41 | firstName: String! @db(name: "FirstName") 42 | hireDate: DateTime @db(name: "HireDate") 43 | lastName: String! @db(name: "LastName") 44 | phone: String @db(name: "Phone") 45 | postalCode: String @db(name: "PostalCode") 46 | reportsTo: Employee @db(name: "ReportsTo") 47 | state: String @db(name: "State") 48 | title: String @db(name: "Title") 49 | } 50 | 51 | type Genre { 52 | GenreId: Int! @id 53 | name: String @db(name: "Name") 54 | track: [Track] 55 | } 56 | 57 | type Invoice { 58 | billingAddress: String @db(name: "BillingAddress") 59 | billingCity: String @db(name: "BillingCity") 60 | billingCountry: String @db(name: "BillingCountry") 61 | billingPostalCode: String @db(name: "BillingPostalCode") 62 | billingState: String @db(name: "BillingState") 63 | customerId: Customer! @db(name: "CustomerId") 64 | invoiceDate: DateTime! @db(name: "InvoiceDate") 65 | InvoiceId: Int! @id 66 | invoiceLine: [InvoiceLine] 67 | total: Float! @db(name: "Total") 68 | } 69 | 70 | type InvoiceLine { 71 | invoiceId: Invoice! @db(name: "InvoiceId") 72 | InvoiceLineId: Int! @id 73 | quantity: Int! @db(name: "Quantity") 74 | trackId: Track! @db(name: "TrackId") 75 | unitPrice: Float! @db(name: "UnitPrice") 76 | } 77 | 78 | type MediaType { 79 | MediaTypeId: Int! @id 80 | name: String @db(name: "Name") 81 | track: [Track] 82 | } 83 | 84 | type Playlist { 85 | name: String @db(name: "Name") 86 | PlaylistId: Int! @id 87 | playlistTrack: [PlaylistTrack] 88 | } 89 | 90 | type PlaylistTrack @linkTable { 91 | playlistId: Playlist! @db(name: "PlaylistId") 92 | trackId: Track! @db(name: "TrackId") 93 | } 94 | 95 | type Track { 96 | albumId: Album @db(name: "AlbumId") 97 | bytes: Int @db(name: "Bytes") 98 | composer: String @db(name: "Composer") 99 | genreId: Genre @db(name: "GenreId") 100 | invoiceLine: [InvoiceLine] 101 | mediaTypeId: MediaType! @db(name: "MediaTypeId") 102 | milliseconds: Int! @db(name: "Milliseconds") 103 | name: String! @db(name: "Name") 104 | playlistTrack: [PlaylistTrack] 105 | TrackId: Int! @id 106 | unitPrice: Float! @db(name: "UnitPrice") 107 | } 108 | -------------------------------------------------------------------------------- /postgres/chinook/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model { 2 | albumId: Int @id 3 | artistId: Artist 4 | title: String 5 | track: Track[]? 6 | } 7 | 8 | model { 9 | artistId: Int @id 10 | album: Album[] 11 | name: String? 12 | } 13 | 14 | model { 15 | customerId: Int @id 16 | address: String? 17 | city: String? 18 | company: String? 19 | country: String? 20 | email: String 21 | fax: String? 22 | firstName: String 23 | invoice: Invoice[] 24 | lastName: String 25 | phone: String? 26 | postalCode: String? 27 | state: String? 28 | supportRepId: Employee? 29 | } 30 | 31 | model { 32 | employeeId: Int @id 33 | address: String? 34 | birthDate: DateTime? 35 | city: String? 36 | country: String? 37 | customer: Customer[]? 38 | email: String? 39 | employee: Employee[]? 40 | fax: String? 41 | firstName: String 42 | hireDate: DateTime? 43 | lastName: String 44 | phone: String? 45 | postalCode: String? 46 | reportsTo: Employee? 47 | state: String? 48 | title: String? 49 | } 50 | 51 | model { 52 | genreId: Int @id 53 | name: String? 54 | track: Track[]? 55 | } 56 | 57 | model { 58 | invoiceId: Int @id 59 | billingAddress: String? 60 | billingCity: String? 61 | billingCountry: String? 62 | billingPostalCode: String? 63 | billingState: String? 64 | customerId: Customer 65 | invoiceDate: DateTime 66 | invoiceLine: InvoiceLine[] 67 | total: Float 68 | } 69 | 70 | model { 71 | invoiceLineId: Int @id 72 | invoiceId: Invoice 73 | quantity: Int 74 | trackId: Track 75 | unitPrice: Float 76 | } 77 | 78 | model { 79 | mediaTypeId: Int @id 80 | name: String? 81 | track: Track[] 82 | } 83 | 84 | model { 85 | playlistId: Int @id 86 | name: String? 87 | playlistTrack: PlaylistTrack[] 88 | } 89 | 90 | model { 91 | playlistId: Playlist 92 | trackId: Track 93 | } 94 | 95 | model { 96 | trackId: Int @id 97 | albumId: Album? 98 | bytes: Int? 99 | composer: String? 100 | genreId: Genre? 101 | invoiceLine: InvoiceLine[] 102 | mediaTypeId: MediaType 103 | milliseconds: Int 104 | name: String 105 | playlistTrack: PlaylistTrack[] 106 | unitPrice: Float 107 | } 108 | -------------------------------------------------------------------------------- /postgres/chinook/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model { 2 | albumId: Int @id 3 | artistId: Artist 4 | title: String 5 | track: Track[]? 6 | } 7 | 8 | model { 9 | artistId: Int @id 10 | album: Album[] 11 | name: String? 12 | } 13 | 14 | model { 15 | customerId: Int @id 16 | address: String? 17 | city: String? 18 | company: String? 19 | country: String? 20 | email: String 21 | fax: String? 22 | firstName: String 23 | invoice: Invoice[] 24 | lastName: String 25 | phone: String? 26 | postalCode: String? 27 | state: String? 28 | supportRepId: Employee? 29 | } 30 | 31 | model { 32 | employeeId: Int @id 33 | address: String? 34 | birthDate: DateTime? 35 | city: String? 36 | country: String? 37 | customer: Customer[]? 38 | email: String? 39 | employee: Employee[]? 40 | fax: String? 41 | firstName: String 42 | hireDate: DateTime? 43 | lastName: String 44 | phone: String? 45 | postalCode: String? 46 | reportsTo: Employee? 47 | state: String? 48 | title: String? 49 | } 50 | 51 | model { 52 | genreId: Int @id 53 | name: String? 54 | track: Track[]? 55 | } 56 | 57 | model { 58 | invoiceId: Int @id 59 | billingAddress: String? 60 | billingCity: String? 61 | billingCountry: String? 62 | billingPostalCode: String? 63 | billingState: String? 64 | customerId: Customer 65 | invoiceDate: DateTime 66 | invoiceLine: InvoiceLine[] 67 | total: Float 68 | } 69 | 70 | model { 71 | invoiceLineId: Int @id 72 | invoiceId: Invoice 73 | quantity: Int 74 | trackId: Track 75 | unitPrice: Float 76 | } 77 | 78 | model { 79 | mediaTypeId: Int @id 80 | name: String? 81 | track: Track[] 82 | } 83 | 84 | model { 85 | playlistId: Int @id 86 | name: String? 87 | playlistTrack: PlaylistTrack[] 88 | } 89 | 90 | model { 91 | playlistId: Playlist 92 | trackId: Track 93 | } 94 | 95 | model { 96 | trackId: Int @id 97 | albumId: Album? 98 | bytes: Int? 99 | composer: String? 100 | genreId: Genre? 101 | invoiceLine: InvoiceLine[] 102 | mediaTypeId: MediaType 103 | milliseconds: Int 104 | name: String 105 | playlistTrack: PlaylistTrack[] 106 | unitPrice: Float 107 | } 108 | -------------------------------------------------------------------------------- /postgres/chinook/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model { 2 | albumId Int @id 3 | artistId Artist 4 | title String 5 | track Track[]? 6 | } 7 | 8 | model { 9 | artistId Int @id 10 | album Album[] 11 | name String? 12 | } 13 | 14 | model { 15 | customerId Int @id 16 | address String? 17 | city String? 18 | company String? 19 | country String? 20 | email String 21 | fax String? 22 | firstName String 23 | invoice Invoice[] 24 | lastName String 25 | phone String? 26 | postalCode String? 27 | state String? 28 | supportRepId Employee? 29 | } 30 | 31 | model { 32 | employeeId Int @id 33 | address String? 34 | birthDate DateTime? 35 | city String? 36 | country String? 37 | customer Customer[]? 38 | email String? 39 | employee Employee[]? 40 | fax String? 41 | firstName String 42 | hireDate DateTime? 43 | lastName String 44 | phone String? 45 | postalCode String? 46 | reportsTo Employee? 47 | state String? 48 | title String? 49 | } 50 | 51 | model { 52 | genreId Int @id 53 | name String? 54 | track Track[]? 55 | } 56 | 57 | model { 58 | invoiceId Int @id 59 | billingAddress String? 60 | billingCity String? 61 | billingCountry String? 62 | billingPostalCode String? 63 | billingState String? 64 | customerId Customer 65 | invoiceDate DateTime 66 | invoiceLine InvoiceLine[] 67 | total Float 68 | } 69 | 70 | model { 71 | invoiceLineId Int @id 72 | invoiceId Invoice 73 | quantity Int 74 | trackId Track 75 | unitPrice Float 76 | } 77 | 78 | model { 79 | mediaTypeId Int @id 80 | name String? 81 | track Track[] 82 | } 83 | 84 | model { 85 | playlistId Int @id 86 | name String? 87 | playlistTrack PlaylistTrack[] 88 | } 89 | 90 | model { 91 | playlistId Playlist 92 | trackId Track 93 | } 94 | 95 | model { 96 | trackId Int @id 97 | albumId Album? 98 | bytes Int? 99 | composer String? 100 | genreId Genre? 101 | invoiceLine InvoiceLine[] 102 | mediaTypeId MediaType 103 | milliseconds Int 104 | name String 105 | playlistTrack PlaylistTrack[] 106 | unitPrice Float 107 | } 108 | -------------------------------------------------------------------------------- /postgres/cms-utilization-db/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | https://github.com/sudowing/cms-utilization-db 3 | 4 | ## Modifications made to source 5 | * None 6 | 7 | -------------------------------------------------------------------------------- /postgres/discourse/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | Extracted via `pg_dump` from our production Discouse Forum 3 | 4 | ## Datamodel 5 | 6 | `datamodel.graphql` was exported with Prisma CLI `prisma/1.31.0-alpha.1` 7 | -------------------------------------------------------------------------------- /postgres/exo/README.md: -------------------------------------------------------------------------------- 1 | # Exo 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 6.0 6 | - Website: https://www.exoplatform.com/ 7 | - Source: https://hub.docker.com/r/exoplatform/exo 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/gitlab/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: gitlab.com 4 | Please follow: https://gitlab.com/gitlab-org/gitlab/issues/29465 5 | -------------------------------------------------------------------------------- /postgres/helpdesk/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://www.totaljs.com/helpdesk/ 4 | -------------------------------------------------------------------------------- /postgres/jira/README.md: -------------------------------------------------------------------------------- 1 | # Jira 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 8.0.2 6 | - Website: https://www.atlassian.com/software/jira 7 | - Source: https://hub.docker.com/r/cptactionhank/atlassian-jira 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/mastodon/README.md: -------------------------------------------------------------------------------- 1 | # Mastodon 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 3.1.1 6 | - Website: https://joinmastodon.org/ 7 | - Source: https://docs.joinmastodon.org/admin/install/ 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/niko-public-1/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | Niko created this 3 | 4 | -------------------------------------------------------------------------------- /postgres/niko-public-1/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE users ( 2 | user_id SERIAL PRIMARY KEY NOT NULL, 3 | name VARCHAR(256), 4 | email VARCHAR(256) UNIQUE NOT NULL 5 | ); 6 | CREATE TABLE posts ( 7 | post_id SERIAL PRIMARY KEY NOT NULL, 8 | created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, 9 | title VARCHAR(256) NOT NULL, 10 | content TEXT, 11 | author_id INTEGER REFERENCES users(user_id) 12 | ); 13 | CREATE TABLE profiles ( 14 | profile_id SERIAL PRIMARY KEY NOT NULL, 15 | bio TEXT, 16 | user_id INTEGER NOT NULL REFERENCES users(user_id) 17 | ); 18 | CREATE TABLE categories ( 19 | category_id SERIAL PRIMARY KEY NOT NULL, 20 | name VARCHAR(256) 21 | ); 22 | CREATE TABLE post_in_categories ( 23 | post_id INTEGER NOT NULL REFERENCES posts(post_id), 24 | category_id INTEGER NOT NULL REFERENCES categories(category_id) 25 | ); 26 | -------------------------------------------------------------------------------- /postgres/noalyss-account/README.md: -------------------------------------------------------------------------------- 1 | # Noalyss 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 7.2 6 | - Website: noalyss.eu 7 | - Source: http://wiki.noalyss.eu/doku.php?id=installation:installation_sous_linux 8 | 9 | Note: This is the account database which Noalyss created 10 | 11 | ## Modifications made to source 12 | 13 | - Changed owner to `prisma` 14 | -------------------------------------------------------------------------------- /postgres/noalyss-account/data.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- PostgreSQL database dump 3 | -- 4 | -- Dumped from database version 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) 5 | -- Dumped by pg_dump version 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) 6 | SET 7 | statement_timeout = 0; 8 | SET 9 | lock_timeout = 0; 10 | SET 11 | idle_in_transaction_session_timeout = 0; 12 | SET 13 | client_encoding = 'UTF8'; 14 | SET 15 | standard_conforming_strings = on; 16 | SELECT 17 | pg_catalog.set_config('search_path', '', false); 18 | SET 19 | check_function_bodies = false; 20 | SET 21 | xmloption = content; 22 | SET 23 | client_min_messages = warning; 24 | SET 25 | row_security = off; 26 | -- 27 | -- Data for Name: ac_dossier; Type: TABLE DATA; Schema: public; Owner: prisma 28 | -- 29 | COPY public.ac_dossier (dos_id, dos_name, dos_description, dos_email) 30 | FROM stdin; 31 | \.-- 32 | -- Data for Name: ac_users; Type: TABLE DATA; Schema: public; Owner: prisma 33 | -- 34 | COPY public.ac_users ( 35 | use_id, 36 | use_first_name, 37 | use_name, 38 | use_login, 39 | use_active, 40 | use_pass, 41 | use_admin, 42 | use_email 43 | ) 44 | FROM stdin; 45 | 4 demo demo demo 0 fe01ce2a7fbac8fafaed7c982a04e229 0 \ N 1 \ N \ N admin 1 b1cc88e1907cde80cb2595fa793b3da9 1 \.-- 46 | -- Data for Name: audit_connect; Type: TABLE DATA; Schema: public; Owner: prisma 47 | -- 48 | COPY public.audit_connect ( 49 | ac_id, 50 | ac_user, 51 | ac_date, 52 | ac_ip, 53 | ac_state, 54 | ac_module, 55 | ac_url 56 | ) 57 | FROM stdin; 58 | 1 admin 2020 -02 -14 14 :53 :20.303312 49.207.85.194 SUCCESS LOGIN / noalyss / html / login.php \.-- 59 | -- Data for Name: dossier_sent_email; Type: TABLE DATA; Schema: public; Owner: prisma 60 | -- 61 | COPY public.dossier_sent_email (id, de_date, de_sent_email, dos_id) 62 | FROM stdin; 63 | \.-- 64 | -- Data for Name: jnt_use_dos; Type: TABLE DATA; Schema: public; Owner: prisma 65 | -- 66 | COPY public.jnt_use_dos (jnt_id, use_id, dos_id) 67 | FROM stdin; 68 | \.-- 69 | -- Data for Name: modeledef; Type: TABLE DATA; Schema: public; Owner: prisma 70 | -- 71 | COPY public.modeledef (mod_id, mod_name, mod_desc) 72 | FROM stdin; 73 | 1 (BE) Basique Comptabilité Belge, 74 | à adapter 2 (FR) Basique Comptabilité Française, 75 | à adapter \.-- 76 | -- Data for Name: progress; Type: TABLE DATA; Schema: public; Owner: prisma 77 | -- 78 | COPY public.progress (p_id, p_value, p_created) 79 | FROM stdin; 80 | \.-- 81 | -- Data for Name: recover_pass; Type: TABLE DATA; Schema: public; Owner: prisma 82 | -- 83 | COPY public.recover_pass ( 84 | use_id, 85 | request, 86 | password, 87 | created_on, 88 | created_host, 89 | recover_on, 90 | recover_by 91 | ) 92 | FROM stdin; 93 | \.-- 94 | -- Data for Name: theme; Type: TABLE DATA; Schema: public; Owner: prisma 95 | -- 96 | COPY public.theme (the_name, the_filestyle, the_filebutton) 97 | FROM stdin; 98 | Light style - light.css \ N Classique style - classic.css \ N Classic7 style - classic7.css \ N \.-- 99 | -- Data for Name: user_global_pref; Type: TABLE DATA; Schema: public; Owner: prisma 100 | -- 101 | COPY public.user_global_pref (user_id, parameter_type, parameter_value) 102 | FROM stdin; 103 | demo PAGESIZE 50 demo LANG fr_FR.utf8 admin PAGESIZE 50 admin TOPMENU TEXT demo THEME Classic7 admin csv_fieldsep 0 admin csv_decimal 0 admin csv_encoding utf8 admin THEME Classic7 admin LANG en_US.utf8 \.-- 104 | -- Data for Name: version; Type: TABLE DATA; Schema: public; Owner: prisma 105 | -- 106 | COPY public.version (val) 107 | FROM stdin; 108 | 18 \.-- 109 | -- Name: audit_connect_ac_id_seq; Type: SEQUENCE SET; Schema: public; Owner: prisma 110 | -- 111 | SELECT 112 | pg_catalog.setval('public.audit_connect_ac_id_seq', 1, true); 113 | -- 114 | -- Name: dossier_id; Type: SEQUENCE SET; Schema: public; Owner: prisma 115 | -- 116 | SELECT 117 | pg_catalog.setval('public.dossier_id', 24, true); 118 | -- 119 | -- Name: dossier_sent_email_id_seq; Type: SEQUENCE SET; Schema: public; Owner: prisma 120 | -- 121 | SELECT 122 | pg_catalog.setval('public.dossier_sent_email_id_seq', 1, false); 123 | -- 124 | -- Name: s_modid; Type: SEQUENCE SET; Schema: public; Owner: prisma 125 | -- 126 | SELECT 127 | pg_catalog.setval('public.s_modid', 8, true); 128 | -- 129 | -- Name: seq_jnt_use_dos; Type: SEQUENCE SET; Schema: public; Owner: prisma 130 | -- 131 | SELECT 132 | pg_catalog.setval('public.seq_jnt_use_dos', 28, true); 133 | -- 134 | -- Name: seq_priv_user; Type: SEQUENCE SET; Schema: public; Owner: prisma 135 | -- 136 | SELECT 137 | pg_catalog.setval('public.seq_priv_user', 12, true); 138 | -- 139 | -- Name: users_id; Type: SEQUENCE SET; Schema: public; Owner: prisma 140 | -- 141 | SELECT 142 | pg_catalog.setval('public.users_id', 5, true); 143 | -- 144 | -- PostgreSQL database dump complete 145 | -- -------------------------------------------------------------------------------- /postgres/noalyss-folder/README.md: -------------------------------------------------------------------------------- 1 | # Noalyss 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 7.2 6 | - Website: noalyss.eu 7 | - Source: http://wiki.noalyss.eu/doku.php?id=installation:installation_sous_linux 8 | 9 | Note: This is the folder database that noalyss created 10 | 11 | ## Modifications made to source 12 | 13 | - Changed owner to `prisma` 14 | -------------------------------------------------------------------------------- /postgres/northwind/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | https://github.com/pthom/northwind_psql 3 | 4 | ## Modifications made to source 5 | * None 6 | 7 | -------------------------------------------------------------------------------- /postgres/northwind/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Category @db(name: "categories") { 2 | category_id: Int! @id 3 | categoryName: String! @db(name: "category_name") 4 | description: String 5 | # Type bytea is not supported 6 | # picture: bytea 7 | products: [Product] 8 | } 9 | 10 | type Customer @db(name: "customers") { 11 | address: String 12 | city: String 13 | companyName: String! @db(name: "company_name") 14 | contactName: String @db(name: "contact_name") 15 | contactTitle: String @db(name: "contact_title") 16 | country: String 17 | customer_id: ID! @id 18 | customerCustomerDemo: [CustomerCustomerDemo] 19 | fax: String 20 | orders: [Order] 21 | phone: String 22 | postalCode: String @db(name: "postal_code") 23 | region: String 24 | } 25 | 26 | type CustomerCustomerDemo @db(name: "customer_customer_demo") @linkTable { 27 | customer: Customer! @db(name: "customer_id") 28 | customerType: CustomerDemographic! @db(name: "customer_type_id") 29 | } 30 | 31 | type CustomerDemographic @db(name: "customer_demographics") { 32 | customer_type_id: ID! @id 33 | customerCustomerDemo: [CustomerCustomerDemo] 34 | customerDesc: String @db(name: "customer_desc") 35 | } 36 | 37 | type Employee @db(name: "employees") { 38 | address: String 39 | birthDate: DateTime @db(name: "birth_date") 40 | city: String 41 | country: String 42 | employee_id: Int! @id 43 | employees: [Employee] 44 | employeeTerritories: [EmployeeTerritory] 45 | extension: String 46 | firstName: String! @db(name: "first_name") 47 | hireDate: DateTime @db(name: "hire_date") 48 | homePhone: String @db(name: "home_phone") 49 | lastName: String! @db(name: "last_name") 50 | notes: String 51 | orders: [Order] 52 | # Type bytea is not supported 53 | # photo: bytea 54 | photoPath: String @db(name: "photo_path") 55 | postalCode: String @db(name: "postal_code") 56 | region: String 57 | reportsTo: Employee @db(name: "reports_to") 58 | title: String 59 | titleOfCourtesy: String @db(name: "title_of_courtesy") 60 | } 61 | 62 | type EmployeeTerritory @db(name: "employee_territories") @linkTable { 63 | employee: Employee! @db(name: "employee_id") 64 | territory: Territory! @db(name: "territory_id") 65 | } 66 | 67 | type Order @db(name: "orders") { 68 | customer: Customer @db(name: "customer_id") 69 | employee: Employee @db(name: "employee_id") 70 | freight: Float 71 | order_id: Int! @id 72 | orderDate: DateTime @db(name: "order_date") 73 | orderDetails: [OrderDetail] 74 | requiredDate: DateTime @db(name: "required_date") 75 | shipAddress: String @db(name: "ship_address") 76 | shipCity: String @db(name: "ship_city") 77 | shipCountry: String @db(name: "ship_country") 78 | shipName: String @db(name: "ship_name") 79 | shippedDate: DateTime @db(name: "shipped_date") 80 | shipPostalCode: String @db(name: "ship_postal_code") 81 | shipRegion: String @db(name: "ship_region") 82 | shipVia: Shipper @db(name: "ship_via") 83 | } 84 | 85 | type OrderDetail @db(name: "order_details") { 86 | discount: Float! 87 | # Multiple ID fields (compound indexes) are not supported 88 | # order_id: Order! @id 89 | # Multiple ID fields (compound indexes) are not supported 90 | # product_id: Product! @id 91 | quantity: Int! 92 | unitPrice: Float! @db(name: "unit_price") 93 | } 94 | 95 | type Product @db(name: "products") { 96 | category: Category @db(name: "category_id") 97 | discontinued: Int! 98 | orderDetails: [OrderDetail] 99 | product_id: Int! @id 100 | productName: String! @db(name: "product_name") 101 | quantityPerUnit: String @db(name: "quantity_per_unit") 102 | reorderLevel: Int @db(name: "reorder_level") 103 | supplier: Supplier @db(name: "supplier_id") 104 | unitPrice: Float @db(name: "unit_price") 105 | unitsInStock: Int @db(name: "units_in_stock") 106 | unitsOnOrder: Int @db(name: "units_on_order") 107 | } 108 | 109 | type Region @db(name: "region") { 110 | region_id: Int! @id 111 | regionDescription: String! @db(name: "region_description") 112 | territories: [Territory] 113 | } 114 | 115 | type Shipper @db(name: "shippers") { 116 | companyName: String! @db(name: "company_name") 117 | orders: [Order] 118 | phone: String 119 | shipper_id: Int! @id 120 | } 121 | 122 | type Supplier @db(name: "suppliers") { 123 | address: String 124 | city: String 125 | companyName: String! @db(name: "company_name") 126 | contactName: String @db(name: "contact_name") 127 | contactTitle: String @db(name: "contact_title") 128 | country: String 129 | fax: String 130 | homepage: String 131 | phone: String 132 | postalCode: String @db(name: "postal_code") 133 | products: [Product] 134 | region: String 135 | supplier_id: Int! @id 136 | } 137 | 138 | type Territory @db(name: "territories") { 139 | employeeTerritories: [EmployeeTerritory] 140 | region: Region! @db(name: "region_id") 141 | territory_id: ID! @id 142 | territoryDescription: String! @db(name: "territory_description") 143 | } 144 | 145 | type UsState @db(name: "us_states") { 146 | state_id: Int! @id 147 | stateAbbr: String @db(name: "state_abbr") 148 | stateName: String @db(name: "state_name") 149 | stateRegion: String @db(name: "state_region") 150 | } 151 | -------------------------------------------------------------------------------- /postgres/northwind/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Category { 2 | categoryId: Int @id 3 | categoryName: String 4 | description: String? 5 | picture: Bytea? 6 | products: Product[]? 7 | } 8 | 9 | model Customer { 10 | customerId: String @id 11 | address: String? 12 | city: String? 13 | companyName: String 14 | contactName: String? 15 | contactTitle: String? 16 | country: String? 17 | customerCustomerDemo: CustomerCustomerDemo[] 18 | fax: String? 19 | orders: Order[]? 20 | phone: String? 21 | postalCode: String? 22 | region: String? 23 | } 24 | 25 | model CustomerCustomerDemo { 26 | customer: Customer 27 | customerType: CustomerDemographic 28 | } 29 | 30 | model CustomerDemographic { 31 | customerTypeId: String @id 32 | customerCustomerDemo: CustomerCustomerDemo[] 33 | customerDesc: String? 34 | } 35 | 36 | model Employee { 37 | employeeId: Int @id 38 | address: String? 39 | birthDate: DateTime? 40 | city: String? 41 | country: String? 42 | employees: Employee[]? 43 | employeeTerritories: EmployeeTerritory[] 44 | extension: String? 45 | firstName: String 46 | hireDate: DateTime? 47 | homePhone: String? 48 | lastName: String 49 | notes: String? 50 | orders: Order[]? 51 | photo: Bytea? 52 | photoPath: String? 53 | postalCode: String? 54 | region: String? 55 | reportsTo: Employee? 56 | title: String? 57 | titleOfCourtesy: String? 58 | } 59 | 60 | model EmployeeTerritory { 61 | employee: Employee 62 | territory: Territory 63 | } 64 | 65 | model Order { 66 | orderId: Int @id 67 | customer: Customer? 68 | employee: Employee? 69 | freight: Float? 70 | orderDate: DateTime? 71 | orderDetails: OrderDetail[] 72 | requiredDate: DateTime? 73 | shipAddress: String? 74 | shipCity: String? 75 | shipCountry: String? 76 | shipName: String? 77 | shippedDate: DateTime? 78 | shipPostalCode: String? 79 | shipRegion: String? 80 | shipVia: Shipper? 81 | } 82 | 83 | model OrderDetail { 84 | productId: Product @id 85 | orderId: Order @id 86 | discount: Float 87 | quantity: Int 88 | unitPrice: Float 89 | } 90 | 91 | model Product { 92 | productId: Int @id 93 | category: Category? 94 | discontinued: Int 95 | orderDetails: OrderDetail[] 96 | productName: String 97 | quantityPerUnit: String? 98 | reorderLevel: Int? 99 | supplier: Supplier? 100 | unitPrice: Float? 101 | unitsInStock: Int? 102 | unitsOnOrder: Int? 103 | } 104 | 105 | model Region { 106 | regionId: Int @id 107 | regionDescription: String 108 | territories: Territory[] 109 | } 110 | 111 | model Shipper { 112 | shipperId: Int @id 113 | companyName: String 114 | orders: Order[]? 115 | phone: String? 116 | } 117 | 118 | model Supplier { 119 | supplierId: Int @id 120 | address: String? 121 | city: String? 122 | companyName: String 123 | contactName: String? 124 | contactTitle: String? 125 | country: String? 126 | fax: String? 127 | homepage: String? 128 | phone: String? 129 | postalCode: String? 130 | products: Product[]? 131 | region: String? 132 | } 133 | 134 | model Territory { 135 | territoryId: String @id 136 | employeeTerritories: EmployeeTerritory[] 137 | region: Region 138 | territoryDescription: String 139 | } 140 | 141 | model MeState { 142 | stateId: Int @id 143 | stateAbbr: String? 144 | stateName: String? 145 | stateRegion: String? 146 | } 147 | -------------------------------------------------------------------------------- /postgres/northwind/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Category { 2 | categoryId: Int @id 3 | categoryName: String 4 | description: String? 5 | picture: Bytea? 6 | products: Product[]? 7 | } 8 | 9 | model Customer { 10 | customerId: String @id 11 | address: String? 12 | city: String? 13 | companyName: String 14 | contactName: String? 15 | contactTitle: String? 16 | country: String? 17 | customerCustomerDemo: CustomerCustomerDemo[] 18 | fax: String? 19 | orders: Order[]? 20 | phone: String? 21 | postalCode: String? 22 | region: String? 23 | } 24 | 25 | model CustomerCustomerDemo { 26 | customer: Customer 27 | customerType: CustomerDemographic 28 | } 29 | 30 | model CustomerDemographic { 31 | customerTypeId: String @id 32 | customerCustomerDemo: CustomerCustomerDemo[] 33 | customerDesc: String? 34 | } 35 | 36 | model Employee { 37 | employeeId: Int @id 38 | address: String? 39 | birthDate: DateTime? 40 | city: String? 41 | country: String? 42 | employees: Employee[]? 43 | employeeTerritories: EmployeeTerritory[] 44 | extension: String? 45 | firstName: String 46 | hireDate: DateTime? 47 | homePhone: String? 48 | lastName: String 49 | notes: String? 50 | orders: Order[]? 51 | photo: Bytea? 52 | photoPath: String? 53 | postalCode: String? 54 | region: String? 55 | reportsTo: Employee? 56 | title: String? 57 | titleOfCourtesy: String? 58 | } 59 | 60 | model EmployeeTerritory { 61 | employee: Employee 62 | territory: Territory 63 | } 64 | 65 | model Order { 66 | orderId: Int @id 67 | customer: Customer? 68 | employee: Employee? 69 | freight: Float? 70 | orderDate: DateTime? 71 | orderDetails: OrderDetail[] 72 | requiredDate: DateTime? 73 | shipAddress: String? 74 | shipCity: String? 75 | shipCountry: String? 76 | shipName: String? 77 | shippedDate: DateTime? 78 | shipPostalCode: String? 79 | shipRegion: String? 80 | shipVia: Shipper? 81 | } 82 | 83 | model OrderDetail { 84 | productId: Product @id 85 | orderId: Order @id 86 | discount: Float 87 | quantity: Int 88 | unitPrice: Float 89 | } 90 | 91 | model Product { 92 | productId: Int @id 93 | category: Category? 94 | discontinued: Int 95 | orderDetails: OrderDetail[] 96 | productName: String 97 | quantityPerUnit: String? 98 | reorderLevel: Int? 99 | supplier: Supplier? 100 | unitPrice: Float? 101 | unitsInStock: Int? 102 | unitsOnOrder: Int? 103 | } 104 | 105 | model Region { 106 | regionId: Int @id 107 | regionDescription: String 108 | territories: Territory[] 109 | } 110 | 111 | model Shipper { 112 | shipperId: Int @id 113 | companyName: String 114 | orders: Order[]? 115 | phone: String? 116 | } 117 | 118 | model Supplier { 119 | supplierId: Int @id 120 | address: String? 121 | city: String? 122 | companyName: String 123 | contactName: String? 124 | contactTitle: String? 125 | country: String? 126 | fax: String? 127 | homepage: String? 128 | phone: String? 129 | postalCode: String? 130 | products: Product[]? 131 | region: String? 132 | } 133 | 134 | model Territory { 135 | territoryId: String @id 136 | employeeTerritories: EmployeeTerritory[] 137 | region: Region 138 | territoryDescription: String 139 | } 140 | 141 | model MeState { 142 | stateId: Int @id 143 | stateAbbr: String? 144 | stateName: String? 145 | stateRegion: String? 146 | } 147 | -------------------------------------------------------------------------------- /postgres/northwind/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Category { 2 | categoryId Int @id 3 | categoryName String 4 | description String? 5 | picture Bytea? 6 | products Product[]? 7 | } 8 | 9 | model Customer { 10 | customerId String @id 11 | address String? 12 | city String? 13 | companyName String 14 | contactName String? 15 | contactTitle String? 16 | country String? 17 | customerCustomerDemo CustomerCustomerDemo[] 18 | fax String? 19 | orders Order[]? 20 | phone String? 21 | postalCode String? 22 | region String? 23 | } 24 | 25 | model CustomerCustomerDemo { 26 | customer Customer 27 | customerType CustomerDemographic 28 | } 29 | 30 | model CustomerDemographic { 31 | customerTypeId String @id 32 | customerCustomerDemo CustomerCustomerDemo[] 33 | customerDesc String? 34 | } 35 | 36 | model Employee { 37 | employeeId Int @id 38 | address String? 39 | birthDate DateTime? 40 | city String? 41 | country String? 42 | employees Employee[]? 43 | employeeTerritories EmployeeTerritory[] 44 | extension String? 45 | firstName String 46 | hireDate DateTime? 47 | homePhone String? 48 | lastName String 49 | notes String? 50 | orders Order[]? 51 | photo Bytea? 52 | photoPath String? 53 | postalCode String? 54 | region String? 55 | reportsTo Employee? 56 | title String? 57 | titleOfCourtesy String? 58 | } 59 | 60 | model EmployeeTerritory { 61 | employee Employee 62 | territory Territory 63 | } 64 | 65 | model Order { 66 | orderId Int @id 67 | customer Customer? 68 | employee Employee? 69 | freight Float? 70 | orderDate DateTime? 71 | orderDetails OrderDetail[] 72 | requiredDate DateTime? 73 | shipAddress String? 74 | shipCity String? 75 | shipCountry String? 76 | shipName String? 77 | shippedDate DateTime? 78 | shipPostalCode String? 79 | shipRegion String? 80 | shipVia Shipper? 81 | } 82 | 83 | model OrderDetail { 84 | productId Product @id 85 | orderId Order @id 86 | discount Float 87 | quantity Int 88 | unitPrice Float 89 | } 90 | 91 | model Product { 92 | productId Int @id 93 | category Category? 94 | discontinued Int 95 | orderDetails OrderDetail[] 96 | productName String 97 | quantityPerUnit String? 98 | reorderLevel Int? 99 | supplier Supplier? 100 | unitPrice Float? 101 | unitsInStock Int? 102 | unitsOnOrder Int? 103 | } 104 | 105 | model Region { 106 | regionId Int @id 107 | regionDescription String 108 | territories Territory[] 109 | } 110 | 111 | model Shipper { 112 | shipperId Int @id 113 | companyName String 114 | orders Order[]? 115 | phone String? 116 | } 117 | 118 | model Supplier { 119 | supplierId Int @id 120 | address String? 121 | city String? 122 | companyName String 123 | contactName String? 124 | contactTitle String? 125 | country String? 126 | fax String? 127 | homepage String? 128 | phone String? 129 | postalCode String? 130 | products Product[]? 131 | region String? 132 | } 133 | 134 | model Territory { 135 | territoryId String @id 136 | employeeTerritories EmployeeTerritory[] 137 | region Region 138 | territoryDescription String 139 | } 140 | 141 | model MeState { 142 | stateId Int @id 143 | stateAbbr String? 144 | stateName String? 145 | stateRegion String? 146 | } 147 | -------------------------------------------------------------------------------- /postgres/odoo/README.md: -------------------------------------------------------------------------------- 1 | # Odoo 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 13.0 6 | - Website: https://www.odoo.com/ 7 | - Source: https://registry.hub.docker.com/_/odoo/?tab=description 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/opendota/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://www.opendota.com/ 4 | -------------------------------------------------------------------------------- /postgres/ruma/README.md: -------------------------------------------------------------------------------- 1 | # Ruma 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 8d0817090620f93dc9f421304154c7322f3ac6ab (Git hash) 6 | - Website: https://www.ruma.io/ 7 | - Source: https://github.com/ruma/ruma/blob/master/migrations/001_prerelease/up.sql 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/sakila/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | http://www.postgresqltutorial.com/postgresql-sample-database/ 3 | 4 | ## Modifications made to source 5 | * Removed the COPY statements that imported the data. 6 | 7 | -------------------------------------------------------------------------------- /postgres/sakila/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Actor { 2 | actorId: Int @id @pg.serial("actor_actor_id_seq") 3 | filmActor: FilmActor[] 4 | firstName: String 5 | lastName: String 6 | lastUpdate: DateTime 7 | } 8 | 9 | model Address { 10 | addressId: Int @id @pg.serial("address_address_id_seq") 11 | address: String 12 | address2: String? 13 | city: City 14 | customer: Customer[] 15 | district: String 16 | lastUpdate: DateTime 17 | phone: String 18 | postalCode: String? 19 | staff: Staff[] 20 | store: Store[] 21 | } 22 | 23 | model Category { 24 | categoryId: Int @id @pg.serial("category_category_id_seq") 25 | filmCategory: FilmCategory[] 26 | lastUpdate: DateTime 27 | name: String 28 | } 29 | 30 | model City { 31 | cityId: Int @id @pg.serial("city_city_id_seq") 32 | address: Address[] 33 | city: String 34 | country: Country 35 | lastUpdate: DateTime 36 | } 37 | 38 | model Country { 39 | countryId: Int @id @pg.serial("country_country_id_seq") 40 | city: City[] 41 | country: String 42 | lastUpdate: DateTime 43 | } 44 | 45 | model Customer { 46 | customerId: Int @id @pg.serial("customer_customer_id_seq") 47 | active: Int? 48 | activebool: Boolean @default(true) 49 | address: Address 50 | createDate: DateTime 51 | email: String? 52 | firstName: String 53 | lastName: String 54 | lastUpdate: DateTime? 55 | payment: Payment[] 56 | rental: Rental[] 57 | storeId: Int 58 | } 59 | 60 | model Film { 61 | filmId: Int @id @pg.serial("film_film_id_seq") 62 | description: String? 63 | filmActor: FilmActor[] 64 | filmCategory: FilmCategory[] 65 | fulltext: Tsvector 66 | inventory: Inventory[] 67 | language: Language 68 | lastUpdate: DateTime 69 | length: Int? 70 | rating: MpaaRating? 71 | releaseYear: Int? 72 | rentalDuration: Int @default(3) 73 | rentalRate: Float @default(4.99) 74 | replacementCost: Float @default(19.99) 75 | specialFeatures: String? 76 | title: String 77 | } 78 | 79 | model FilmActor { 80 | filmId: Film @id 81 | actorId: Actor @id 82 | lastUpdate: DateTime 83 | } 84 | 85 | model FilmCategory { 86 | filmId: Film @id 87 | categoryId: Category @id 88 | lastUpdate: DateTime 89 | } 90 | 91 | model Inventory { 92 | inventoryId: Int @id @pg.serial("inventory_inventory_id_seq") 93 | film: Film 94 | lastUpdate: DateTime 95 | rental: Rental[] 96 | storeId: Int 97 | } 98 | 99 | model Language { 100 | languageId: Int @id @pg.serial("language_language_id_seq") 101 | film: Film[] 102 | lastUpdate: DateTime 103 | name: String 104 | } 105 | 106 | enum MpaaRating { 107 | G = "G" 108 | Nc_17 = "NC-17" 109 | Pg = "PG" 110 | Pg_13 = "PG-13" 111 | R = "R" 112 | } 113 | 114 | model Payment { 115 | paymentId: Int @id @pg.serial("payment_payment_id_seq") 116 | amount: Float 117 | customer: Customer 118 | paymentDate: DateTime 119 | rental: Rental 120 | staff: Staff 121 | } 122 | 123 | model Rental { 124 | rentalId: Int @id @pg.serial("rental_rental_id_seq") 125 | customer: Customer 126 | inventory: Inventory 127 | lastUpdate: DateTime 128 | payment: Payment[] 129 | rentalDate: DateTime 130 | returnDate: DateTime? 131 | staff: Staff 132 | } 133 | 134 | model Staff { 135 | staffId: Int @id @pg.serial("staff_staff_id_seq") 136 | active: Boolean @default(true) 137 | address: Address 138 | email: String? 139 | firstName: String 140 | lastName: String 141 | lastUpdate: DateTime 142 | password: String? 143 | payment: Payment[] 144 | picture: Bytea? 145 | rental: Rental[] 146 | store: Store 147 | storeId: Int 148 | username: String 149 | } 150 | 151 | model Store { 152 | storeId: Int @id @pg.serial("store_store_id_seq") 153 | address: Address 154 | lastUpdate: DateTime 155 | managerStaff: Staff @unique 156 | } 157 | -------------------------------------------------------------------------------- /postgres/sakila/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Actor { 2 | actorId: Int @id @pg.serial("actor_actor_id_seq") 3 | filmActor: FilmActor[] 4 | firstName: String 5 | lastName: String 6 | lastUpdate: DateTime 7 | } 8 | 9 | model Address { 10 | addressId: Int @id @pg.serial("address_address_id_seq") 11 | address: String 12 | address2: String? 13 | city: City 14 | customer: Customer[] 15 | district: String 16 | lastUpdate: DateTime 17 | phone: String 18 | postalCode: String? 19 | staff: Staff[] 20 | store: Store[] 21 | } 22 | 23 | model Category { 24 | categoryId: Int @id @pg.serial("category_category_id_seq") 25 | filmCategory: FilmCategory[] 26 | lastUpdate: DateTime 27 | name: String 28 | } 29 | 30 | model City { 31 | cityId: Int @id @pg.serial("city_city_id_seq") 32 | address: Address[] 33 | city: String 34 | country: Country 35 | lastUpdate: DateTime 36 | } 37 | 38 | model Country { 39 | countryId: Int @id @pg.serial("country_country_id_seq") 40 | city: City[] 41 | country: String 42 | lastUpdate: DateTime 43 | } 44 | 45 | model Customer { 46 | customerId: Int @id @pg.serial("customer_customer_id_seq") 47 | active: Int? 48 | activebool: Boolean @default(true) 49 | address: Address 50 | createDate: DateTime 51 | email: String? 52 | firstName: String 53 | lastName: String 54 | lastUpdate: DateTime? 55 | payment: Payment[] 56 | rental: Rental[] 57 | storeId: Int 58 | } 59 | 60 | model Film { 61 | filmId: Int @id @pg.serial("film_film_id_seq") 62 | description: String? 63 | filmActor: FilmActor[] 64 | filmCategory: FilmCategory[] 65 | fulltext: Tsvector 66 | inventory: Inventory[] 67 | language: Language 68 | lastUpdate: DateTime 69 | length: Int? 70 | rating: MpaaRating? 71 | releaseYear: Int? 72 | rentalDuration: Int @default(3) 73 | rentalRate: Float @default(4.99) 74 | replacementCost: Float @default(19.99) 75 | specialFeatures: String? 76 | title: String 77 | } 78 | 79 | model FilmActor { 80 | filmId: Film @id 81 | actorId: Actor @id 82 | lastUpdate: DateTime 83 | } 84 | 85 | model FilmCategory { 86 | filmId: Film @id 87 | categoryId: Category @id 88 | lastUpdate: DateTime 89 | } 90 | 91 | model Inventory { 92 | inventoryId: Int @id @pg.serial("inventory_inventory_id_seq") 93 | film: Film 94 | lastUpdate: DateTime 95 | rental: Rental[] 96 | storeId: Int 97 | } 98 | 99 | model Language { 100 | languageId: Int @id @pg.serial("language_language_id_seq") 101 | film: Film[] 102 | lastUpdate: DateTime 103 | name: String 104 | } 105 | 106 | enum MpaaRating { 107 | G = "G" 108 | Nc_17 = "NC-17" 109 | Pg = "PG" 110 | Pg_13 = "PG-13" 111 | R = "R" 112 | } 113 | 114 | model Payment { 115 | paymentId: Int @id @pg.serial("payment_payment_id_seq") 116 | amount: Float 117 | customer: Customer 118 | paymentDate: DateTime 119 | rental: Rental 120 | staff: Staff 121 | } 122 | 123 | model Rental { 124 | rentalId: Int @id @pg.serial("rental_rental_id_seq") 125 | customer: Customer 126 | inventory: Inventory 127 | lastUpdate: DateTime 128 | payment: Payment[] 129 | rentalDate: DateTime 130 | returnDate: DateTime? 131 | staff: Staff 132 | } 133 | 134 | model Staff { 135 | staffId: Int @id @pg.serial("staff_staff_id_seq") 136 | active: Boolean @default(true) 137 | address: Address 138 | email: String? 139 | firstName: String 140 | lastName: String 141 | lastUpdate: DateTime 142 | password: String? 143 | payment: Payment[] 144 | picture: Bytea? 145 | rental: Rental[] 146 | store: Store 147 | storeId: Int 148 | username: String 149 | } 150 | 151 | model Store { 152 | storeId: Int @id @pg.serial("store_store_id_seq") 153 | address: Address 154 | lastUpdate: DateTime 155 | managerStaff: Staff @unique 156 | } 157 | -------------------------------------------------------------------------------- /postgres/sakila/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Actor { 2 | actorId Int @id @pg.serial("actor_actor_id_seq") 3 | filmActor FilmActor[] 4 | firstName String 5 | lastName String 6 | lastUpdate DateTime 7 | } 8 | 9 | model Address { 10 | addressId Int @id @pg.serial("address_address_id_seq") 11 | address String 12 | address2 String? 13 | city City 14 | customer Customer[] 15 | district String 16 | lastUpdate DateTime 17 | phone String 18 | postalCode String? 19 | staff Staff[] 20 | store Store[] 21 | } 22 | 23 | model Category { 24 | categoryId Int @id @pg.serial("category_category_id_seq") 25 | filmCategory FilmCategory[] 26 | lastUpdate DateTime 27 | name String 28 | } 29 | 30 | model City { 31 | cityId Int @id @pg.serial("city_city_id_seq") 32 | address Address[] 33 | city String 34 | country Country 35 | lastUpdate DateTime 36 | } 37 | 38 | model Country { 39 | countryId Int @id @pg.serial("country_country_id_seq") 40 | city City[] 41 | country String 42 | lastUpdate DateTime 43 | } 44 | 45 | model Customer { 46 | customerId Int @id @pg.serial("customer_customer_id_seq") 47 | active Int? 48 | activebool Boolean @default(true) 49 | address Address 50 | createDate DateTime 51 | email String? 52 | firstName String 53 | lastName String 54 | lastUpdate DateTime? 55 | payment Payment[] 56 | rental Rental[] 57 | storeId Int 58 | } 59 | 60 | model Film { 61 | filmId Int @id @pg.serial("film_film_id_seq") 62 | description String? 63 | filmActor FilmActor[] 64 | filmCategory FilmCategory[] 65 | fulltext Tsvector 66 | inventory Inventory[] 67 | language Language 68 | lastUpdate DateTime 69 | length Int? 70 | rating MpaaRating? 71 | releaseYear Int? 72 | rentalDuration Int @default(3) 73 | rentalRate Float @default(4.99) 74 | replacementCost Float @default(19.99) 75 | specialFeatures String? 76 | title String 77 | } 78 | 79 | model FilmActor { 80 | filmId Film @id 81 | actorId Actor @id 82 | lastUpdate DateTime 83 | } 84 | 85 | model FilmCategory { 86 | filmId Film @id 87 | categoryId Category @id 88 | lastUpdate DateTime 89 | } 90 | 91 | model Inventory { 92 | inventoryId Int @id @pg.serial("inventory_inventory_id_seq") 93 | film Film 94 | lastUpdate DateTime 95 | rental Rental[] 96 | storeId Int 97 | } 98 | 99 | model Language { 100 | languageId Int @id @pg.serial("language_language_id_seq") 101 | film Film[] 102 | lastUpdate DateTime 103 | name String 104 | } 105 | 106 | enum MpaaRating { 107 | G = "G" 108 | Nc_17 = "NC-17" 109 | Pg = "PG" 110 | Pg_13 = "PG-13" 111 | R = "R" 112 | } 113 | 114 | model Payment { 115 | paymentId Int @id @pg.serial("payment_payment_id_seq") 116 | amount Float 117 | customer Customer 118 | paymentDate DateTime 119 | rental Rental 120 | staff Staff 121 | } 122 | 123 | model Rental { 124 | rentalId Int @id @pg.serial("rental_rental_id_seq") 125 | customer Customer 126 | inventory Inventory 127 | lastUpdate DateTime 128 | payment Payment[] 129 | rentalDate DateTime 130 | returnDate DateTime? 131 | staff Staff 132 | } 133 | 134 | model Staff { 135 | staffId Int @id @pg.serial("staff_staff_id_seq") 136 | active Boolean @default(true) 137 | address Address 138 | email String? 139 | firstName String 140 | lastName String 141 | lastUpdate DateTime 142 | password String? 143 | payment Payment[] 144 | picture Bytea? 145 | rental Rental[] 146 | store Store 147 | storeId Int 148 | username String 149 | } 150 | 151 | model Store { 152 | storeId Int @id @pg.serial("store_store_id_seq") 153 | address Address 154 | lastUpdate DateTime 155 | managerStaff Staff @unique 156 | } 157 | -------------------------------------------------------------------------------- /postgres/shakespeare/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | https://github.com/catherinedevlin/opensourceshakespeare 3 | 4 | ## Modifications made to source 5 | * Removed import of data from `schema_pg.sql`. 6 | 7 | -------------------------------------------------------------------------------- /postgres/shakespeare/datamodel-1.0.groovy: -------------------------------------------------------------------------------- 1 | type Chapter @pgTable(name: "chapter") { 2 | chapter: Int! 3 | id: Int! @pgColumn(name: "chapterid") @unique 4 | description: String! 5 | section: Int! 6 | workid: Work! 7 | } 8 | 9 | type Character @pgTable(name: "character") { 10 | abbrev: String 11 | characterWork: [CharacterWork] 12 | id: ID! @pgColumn(name: "charid") @unique 13 | charname: String! 14 | description: String 15 | paragraph: [Paragraph] 16 | speechcount: Int! 17 | } 18 | 19 | type CharacterWork @linkTable @pgTable(name: "character_work") { 20 | charid: Character! 21 | workid: Work! 22 | } 23 | 24 | type Paragraph @pgTable(name: "paragraph") { 25 | chapter: Int! 26 | charcount: Int! 27 | charid: Character! 28 | id: Int! @pgColumn(name: "paragraphid") @unique 29 | paragraphnum: Int! 30 | paragraphtype: String! 31 | phonetictext: String! 32 | plaintext: String! 33 | section: Int! 34 | stemtext: String! 35 | wordcount: Int! 36 | workid: Work! 37 | } 38 | 39 | type Wordform @pgTable(name: "wordform") { 40 | occurences: Int! 41 | phonetictext: String! 42 | plaintext: String! 43 | stemtext: String! 44 | id: Int! @pgColumn(name: "wordformid") @unique 45 | } 46 | 47 | type Work @pgTable(name: "work") { 48 | chapter: [Chapter] 49 | characterWork: [CharacterWork] 50 | genretype: String! 51 | longtitle: String! 52 | notes: String 53 | paragraph: [Paragraph] 54 | source: String! 55 | title: String! 56 | totalparagraphs: Int! 57 | totalwords: Int! 58 | id: ID! @pgColumn(name: "workid") @unique 59 | year: Int! 60 | } 61 | -------------------------------------------------------------------------------- /postgres/shakespeare/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Chapter @db(name: "chapter") { 2 | chapter: Int! 3 | chapterid: Int! @id 4 | description: String! 5 | section: Int! 6 | workid: Work! 7 | } 8 | 9 | type Character @db(name: "character") { 10 | abbrev: String 11 | characterWork: [CharacterWork] 12 | charid: ID! @id 13 | charname: String! 14 | description: String 15 | paragraph: [Paragraph] 16 | speechcount: Int! 17 | } 18 | 19 | type CharacterWork @db(name: "character_work") @linkTable { 20 | charid: Character! 21 | workid: Work! 22 | } 23 | 24 | type Paragraph @db(name: "paragraph") { 25 | chapter: Int! 26 | charcount: Int! 27 | charid: Character! 28 | paragraphid: Int! @id 29 | paragraphnum: Int! 30 | paragraphtype: String! 31 | phonetictext: String! 32 | plaintext: String! 33 | section: Int! 34 | stemtext: String! 35 | wordcount: Int! 36 | workid: Work! 37 | } 38 | 39 | type Wordform @db(name: "wordform") { 40 | occurences: Int! 41 | phonetictext: String! 42 | plaintext: String! 43 | stemtext: String! 44 | wordformid: Int! @id 45 | } 46 | 47 | type Work @db(name: "work") { 48 | chapter: [Chapter] 49 | characterWork: [CharacterWork] 50 | genretype: String! 51 | longtitle: String! 52 | notes: String 53 | paragraph: [Paragraph] 54 | source: String! 55 | title: String! 56 | totalparagraphs: Int! 57 | totalwords: Int! 58 | workid: ID! @id 59 | year: Int! 60 | } 61 | -------------------------------------------------------------------------------- /postgres/shakespeare/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Chapter { 2 | chapterid: Int @id 3 | chapter: Int 4 | description: String 5 | section: Int 6 | workid: Work 7 | } 8 | 9 | model Character { 10 | charid: String @id 11 | abbrev: String? 12 | characterWork: CharacterWork[] 13 | charname: String 14 | description: String? 15 | paragraph: Paragraph[] 16 | speechcount: Int 17 | } 18 | 19 | model CharacterWork { 20 | charid: Character 21 | workid: Work 22 | } 23 | 24 | model Paragraph { 25 | paragraphid: Int @id 26 | chapter: Int 27 | charcount: Int 28 | charid: Character 29 | paragraphnum: Int 30 | paragraphtype: String 31 | phonetictext: String 32 | plaintext: String 33 | section: Int 34 | stemtext: String 35 | wordcount: Int 36 | workid: Work 37 | } 38 | 39 | model Wordform { 40 | wordformid: Int @id 41 | occurences: Int 42 | phonetictext: String 43 | plaintext: String 44 | stemtext: String 45 | } 46 | 47 | model Work { 48 | workid: String @id 49 | chapter: Chapter[] 50 | characterWork: CharacterWork[] 51 | genretype: String 52 | longtitle: String 53 | notes: String? 54 | paragraph: Paragraph[] 55 | source: String 56 | title: String 57 | totalparagraphs: Int 58 | totalwords: Int 59 | year: Int 60 | } 61 | -------------------------------------------------------------------------------- /postgres/shakespeare/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Chapter { 2 | chapterid: Int @id 3 | chapter: Int 4 | description: String 5 | section: Int 6 | workid: Work 7 | } 8 | 9 | model Character { 10 | charid: String @id 11 | abbrev: String? 12 | characterWork: CharacterWork[] 13 | charname: String 14 | description: String? 15 | paragraph: Paragraph[] 16 | speechcount: Int 17 | } 18 | 19 | model CharacterWork { 20 | charid: Character 21 | workid: Work 22 | } 23 | 24 | model Paragraph { 25 | paragraphid: Int @id 26 | chapter: Int 27 | charcount: Int 28 | charid: Character 29 | paragraphnum: Int 30 | paragraphtype: String 31 | phonetictext: String 32 | plaintext: String 33 | section: Int 34 | stemtext: String 35 | wordcount: Int 36 | workid: Work 37 | } 38 | 39 | model Wordform { 40 | wordformid: Int @id 41 | occurences: Int 42 | phonetictext: String 43 | plaintext: String 44 | stemtext: String 45 | } 46 | 47 | model Work { 48 | workid: String @id 49 | chapter: Chapter[] 50 | characterWork: CharacterWork[] 51 | genretype: String 52 | longtitle: String 53 | notes: String? 54 | paragraph: Paragraph[] 55 | source: String 56 | title: String 57 | totalparagraphs: Int 58 | totalwords: Int 59 | year: Int 60 | } 61 | -------------------------------------------------------------------------------- /postgres/shakespeare/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Chapter { 2 | chapterid Int @id 3 | chapter Int 4 | description String 5 | section Int 6 | workid Work 7 | } 8 | 9 | model Character { 10 | charid String @id 11 | abbrev String? 12 | characterWork CharacterWork[] 13 | charname String 14 | description String? 15 | paragraph Paragraph[] 16 | speechcount Int 17 | } 18 | 19 | model CharacterWork { 20 | charid Character 21 | workid Work 22 | } 23 | 24 | model Paragraph { 25 | paragraphid Int @id 26 | chapter Int 27 | charcount Int 28 | charid Character 29 | paragraphnum Int 30 | paragraphtype String 31 | phonetictext String 32 | plaintext String 33 | section Int 34 | stemtext String 35 | wordcount Int 36 | workid Work 37 | } 38 | 39 | model Wordform { 40 | wordformid Int @id 41 | occurences Int 42 | phonetictext String 43 | plaintext String 44 | stemtext String 45 | } 46 | 47 | model Work { 48 | workid String @id 49 | chapter Chapter[] 50 | characterWork CharacterWork[] 51 | genretype String 52 | longtitle String 53 | notes String? 54 | paragraph Paragraph[] 55 | source String 56 | title String 57 | totalparagraphs Int 58 | totalwords Int 59 | year Int 60 | } 61 | -------------------------------------------------------------------------------- /postgres/shakespeare/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS work CASCADE; 2 | CREATE TABLE work 3 | ( workID VARCHAR(32) PRIMARY KEY, 4 | title VARCHAR(32) NOT NULL, 5 | longTitle VARCHAR(64) NOT NULL, 6 | year INTEGER NOT NULL, 7 | genreType VARCHAR(1) NOT NULL, 8 | notes TEXT, 9 | source VARCHAR(16) NOT NULL, 10 | totalWords INTEGER NOT NULL, 11 | totalParagraphs INTEGER NOT NULL 12 | ); 13 | 14 | DROP TABLE IF EXISTS character CASCADE; 15 | CREATE TABLE character 16 | ( charID VARCHAR(32) PRIMARY KEY, 17 | charName VARCHAR(64) NOT NULL, 18 | abbrev VARCHAR(32), 19 | works VARCHAR(256) NOT NULL, 20 | description VARCHAR(2056), 21 | speechCount INTEGER NOT NULL 22 | ); 23 | 24 | DROP TABLE IF EXISTS character_work; 25 | CREATE TABLE character_work 26 | ( charID VARCHAR(32) NOT NULL REFERENCES character (charID), 27 | workID VARCHAR(32) NOT NULL REFERENCES work (workID), 28 | PRIMARY KEY (charID, workID) 29 | ); 30 | 31 | ALTER TABLE character DROP COLUMN works; 32 | 33 | DROP TABLE IF EXISTS chapter; 34 | CREATE TABLE chapter 35 | ( workID VARCHAR(32) NOT NULL REFERENCES work (workID), 36 | chapterID INTEGER PRIMARY KEY, 37 | section INTEGER NOT NULL, 38 | chapter INTEGER NOT NULL, 39 | description VARCHAR(256) NOT NULL 40 | ); 41 | 42 | DROP TABLE IF EXISTS paragraph; 43 | CREATE TABLE paragraph 44 | ( workID VARCHAR(32) NOT NULL REFERENCES work (workID), paragraphID INTEGER PRIMARY KEY NOT NULL, 45 | paragraphNum INTEGER NOT NULL, 46 | charID VARCHAR(32) NOT NULL REFERENCES character (charID), 47 | plainText TEXT NOT NULL, 48 | phoneticText TEXT NOT NULL, 49 | stemText TEXT NOT NULL, 50 | paragraphType VARCHAR(1) NOT NULL, 51 | section INTEGER NOT NULL, 52 | chapter INTEGER NOT NULL, 53 | charCount INTEGER NOT NULL, 54 | wordCount INTEGER NOT NULL 55 | ); 56 | 57 | DROP TABLE IF EXISTS wordform; 58 | CREATE TABLE wordform 59 | ( wordFormID INTEGER PRIMARY KEY, 60 | plainText VARCHAR(64) NOT NULL, 61 | phoneticText VARCHAR(64) NOT NULL, 62 | stemText VARCHAR(64) NOT NULL, 63 | occurences INTEGER NOT NULL 64 | ); 65 | 66 | -------------------------------------------------------------------------------- /postgres/sonarqube/README.md: -------------------------------------------------------------------------------- 1 | # Sonarqube 2 | 3 | Schema only dump exported via `pg_dump` 4 | 5 | - Version: 8.1 community beta 6 | - Website: https://www.sonarqube.org/ 7 | - Source: https://hub.docker.com/_/sonarqube/?tab=description 8 | 9 | ## Modifications made to source 10 | 11 | - Changed owner to `prisma` 12 | -------------------------------------------------------------------------------- /postgres/sportsdb/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | http://www.sportsdb.org/sd/samples 3 | https://docs.yugabyte.com/latest/sample-data/sportsdb/#about-the-sportsdb-sample-database 4 | 5 | ## Modifications made to source 6 | * Added creation of schema. 7 | 8 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/README.md: -------------------------------------------------------------------------------- 1 | ## Source 2 | Extracted via `pg_dump` 3 | 4 | ## Datamodel 5 | 6 | `datamodel.graphql` was exported with Prisma CLI `prisma/1.31.0-alpha.1` 7 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/datamodel-1.0.groovy: -------------------------------------------------------------------------------- 1 | type Eventid @pgTable(name: "eventids") { 2 | createdAt: DateTime! @pgColumn(name: "created_at") 3 | id: ID! @pgColumn(name: "event_id") @unique 4 | } 5 | 6 | type Migrate @pgTable(name: "migrate") { 7 | id: Int! @pgColumn(name: "version") @unique 8 | } 9 | 10 | type Post @pgTable(name: "posts") { 11 | createdAt: DateTime! @pgColumn(name: "created_at") 12 | id: Int! @unique 13 | reports: [Report] 14 | standup: Standup! @pgColumn(name: "standup_id") 15 | updatedAt: DateTime! @pgColumn(name: "updated_at") 16 | } 17 | 18 | type Question @pgTable(name: "questions") { 19 | createdAt: DateTime! @pgColumn(name: "created_at") 20 | id: Int! @unique 21 | order: Int! 22 | question: String! 23 | standup: Standup! @pgColumn(name: "standup_id") 24 | updatedAt: DateTime! @pgColumn(name: "updated_at") 25 | } 26 | 27 | type Report @pgTable(name: "reports") { 28 | createdAt: DateTime! @pgColumn(name: "created_at") 29 | id: Int! @unique 30 | post: Post @pgColumn(name: "post_id") 31 | questions: Json! 32 | standup: Standup! @pgColumn(name: "standup_id") 33 | status: ReportStatus! 34 | updatedAt: DateTime! @pgColumn(name: "updated_at") 35 | user: User! @pgColumn(name: "user_id") 36 | } 37 | 38 | type Review @pgTable(name: "reviews") { 39 | createdAt: DateTime! @pgColumn(name: "created_at") 40 | id: Int! @unique 41 | text: String! 42 | type: ReviewType! 43 | user: User! @pgColumn(name: "user_id") 44 | } 45 | 46 | type Standup @pgTable(name: "standups") { 47 | channelId: String! @pgColumn(name: "channel_id") 48 | createdAt: DateTime! @pgColumn(name: "created_at") 49 | id: Int! @unique 50 | isThreaded: Boolean! @default(value: false) @pgColumn(name: "is_threaded") 51 | # Type citext is not supported 52 | # name: citext! 53 | posts: [Post] 54 | questions: [Question] 55 | reports: [Report] 56 | standupsUsers: [StandupsUser] 57 | team: Team! @pgColumn(name: "team_id") 58 | # Type time is not supported 59 | # time: time! 60 | timezone: String! 61 | updatedAt: DateTime! @pgColumn(name: "updated_at") 62 | } 63 | 64 | type StandupsUser @pgTable(name: "standups_users") { 65 | createdAt: DateTime! @pgColumn(name: "created_at") 66 | isStandupOwner: Boolean! @default(value: false) @pgColumn(name: "is_standup_owner") 67 | standup: Standup! @pgColumn(name: "standup_id") 68 | status: StandupUserStatus! 69 | # Type time is not supported 70 | # time: time! 71 | updatedAt: DateTime! @pgColumn(name: "updated_at") 72 | user: User! @pgColumn(name: "user_id") 73 | } 74 | 75 | type Team @pgTable(name: "teams") { 76 | botAccessToken: String! @pgColumn(name: "bot_access_token") @unique 77 | botSlackId: String! @pgColumn(name: "bot_slack_id") 78 | costPerUser: Int! @default(value: 100) @pgColumn(name: "cost_per_user") 79 | createdAt: DateTime! @pgColumn(name: "created_at") 80 | id: Int! @unique 81 | minimumMonthlyCost: Int! @default(value: 0) @pgColumn(name: "minimum_monthly_cost") 82 | scope: String! @default(value: "{}") 83 | standups: [Standup] 84 | status: TeamStatus! 85 | stripeId: String @pgColumn(name: "stripe_id") 86 | teamAccessToken: String! @pgColumn(name: "team_access_token") @unique 87 | teamName: String! @pgColumn(name: "team_name") 88 | teamSlackId: String! @pgColumn(name: "team_slack_id") @unique 89 | trialEnds: DateTime! @pgColumn(name: "trial_ends") 90 | updatedAt: DateTime! @pgColumn(name: "updated_at") 91 | users: [User] 92 | } 93 | 94 | type User @pgTable(name: "users") { 95 | avatarUrl: String @pgColumn(name: "avatar_url") 96 | createdAt: DateTime! @pgColumn(name: "created_at") 97 | email: String 98 | firstName: String @pgColumn(name: "first_name") 99 | id: Int! @unique 100 | isTeamOwner: Boolean! @default(value: false) @pgColumn(name: "is_team_owner") 101 | lastName: String @pgColumn(name: "last_name") 102 | reports: [Report] 103 | reviews: [Review] 104 | slackId: String! @pgColumn(name: "slack_id") 105 | standupsUsers: [StandupsUser] 106 | team: Team! @pgColumn(name: "team_id") 107 | timezone: String! 108 | updatedAt: DateTime! @pgColumn(name: "updated_at") 109 | username: String! 110 | } 111 | 112 | enum ReportStatus { 113 | ASKED 114 | COMPLETE 115 | PENDING 116 | SKIP 117 | } 118 | 119 | enum ReviewType { 120 | COMMENT 121 | EXIT_FEEDBACK 122 | REFERRED_BY 123 | } 124 | 125 | enum StandupUserStatus { 126 | ACTIVE 127 | INACTIVE 128 | INVITED 129 | } 130 | 131 | enum TeamStatus { 132 | ACTIVE 133 | DELINQUENT 134 | INACTIVE 135 | } 136 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/datamodel-1.1.groovy: -------------------------------------------------------------------------------- 1 | type Eventid @db(name: "eventids") { 2 | createdAt: DateTime! @db(name: "created_at") 3 | event_id: ID! @id 4 | } 5 | 6 | type Migrate @db(name: "migrate") { 7 | version: Int! @id 8 | } 9 | 10 | type Post @db(name: "posts") { 11 | createdAt: DateTime! @db(name: "created_at") 12 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "posts_id_seq", initialValue: 1, allocationSize: 1) 13 | reports: [Report] 14 | standup: Standup! @db(name: "standup_id") 15 | updatedAt: DateTime! @db(name: "updated_at") 16 | } 17 | 18 | type Question @db(name: "questions") { 19 | createdAt: DateTime! @db(name: "created_at") 20 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "questions_id_seq", initialValue: 1, allocationSize: 1) 21 | order: Int! 22 | question: String! 23 | standup: Standup! @db(name: "standup_id") 24 | updatedAt: DateTime! @db(name: "updated_at") 25 | } 26 | 27 | type Report @db(name: "reports") { 28 | createdAt: DateTime! @db(name: "created_at") 29 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "reports_id_seq", initialValue: 1, allocationSize: 1) 30 | post: Post @db(name: "post_id") 31 | questions: Json! 32 | standup: Standup! @db(name: "standup_id") 33 | status: ReportStatus! 34 | updatedAt: DateTime! @db(name: "updated_at") 35 | user: User! @db(name: "user_id") 36 | } 37 | 38 | type Review @db(name: "reviews") { 39 | createdAt: DateTime! @db(name: "created_at") 40 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "reviews_id_seq", initialValue: 1, allocationSize: 1) 41 | text: String! 42 | type: ReviewType! 43 | user: User! @db(name: "user_id") 44 | } 45 | 46 | type Standup @db(name: "standups") { 47 | channelId: String! @db(name: "channel_id") 48 | createdAt: DateTime! @db(name: "created_at") 49 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "standups_id_seq", initialValue: 1, allocationSize: 1) 50 | isThreaded: Boolean! @db(name: "is_threaded") @default(value: false) 51 | # Type citext is not supported 52 | # name: citext! 53 | posts: [Post] 54 | questions: [Question] 55 | reports: [Report] 56 | standupsUsers: [StandupsUser] 57 | team: Team! @db(name: "team_id") 58 | # Type time is not supported 59 | # time: time! 60 | timezone: String! 61 | updatedAt: DateTime! @db(name: "updated_at") 62 | } 63 | 64 | type StandupsUser @db(name: "standups_users") { 65 | createdAt: DateTime! @db(name: "created_at") 66 | isStandupOwner: Boolean! @db(name: "is_standup_owner") @default(value: false) 67 | standup: Standup! @db(name: "standup_id") 68 | status: StandupUserStatus! 69 | # Type time is not supported 70 | # time: time! 71 | updatedAt: DateTime! @db(name: "updated_at") 72 | user: User! @db(name: "user_id") 73 | } 74 | 75 | type Team @db(name: "teams") { 76 | botAccessToken: String! @db(name: "bot_access_token") @unique 77 | botSlackId: String! @db(name: "bot_slack_id") 78 | costPerUser: Int! @db(name: "cost_per_user") @default(value: 100) 79 | createdAt: DateTime! @db(name: "created_at") 80 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "teams_id_seq", initialValue: 1, allocationSize: 1) 81 | minimumMonthlyCost: Int! @db(name: "minimum_monthly_cost") @default(value: 0) 82 | scope: String! @default(value: "{}") 83 | standups: [Standup] 84 | status: TeamStatus! 85 | stripeId: String @db(name: "stripe_id") 86 | teamAccessToken: String! @db(name: "team_access_token") @unique 87 | teamName: String! @db(name: "team_name") 88 | teamSlackId: String! @db(name: "team_slack_id") @unique 89 | trialEnds: DateTime! @db(name: "trial_ends") 90 | updatedAt: DateTime! @db(name: "updated_at") 91 | users: [User] 92 | } 93 | 94 | type User @db(name: "users") { 95 | avatarUrl: String @db(name: "avatar_url") 96 | createdAt: DateTime! @db(name: "created_at") 97 | email: String 98 | firstName: String @db(name: "first_name") 99 | id: Int! @id(strategy: SEQUENCE) @sequence(name: "users_id_seq", initialValue: 1, allocationSize: 1) 100 | isTeamOwner: Boolean! @db(name: "is_team_owner") @default(value: false) 101 | lastName: String @db(name: "last_name") 102 | reports: [Report] 103 | reviews: [Review] 104 | slackId: String! @db(name: "slack_id") 105 | standupsUsers: [StandupsUser] 106 | team: Team! @db(name: "team_id") 107 | timezone: String! 108 | updatedAt: DateTime! @db(name: "updated_at") 109 | username: String! 110 | } 111 | 112 | enum ReportStatus { 113 | ASKED 114 | COMPLETE 115 | PENDING 116 | SKIP 117 | } 118 | 119 | enum ReviewType { 120 | COMMENT 121 | EXIT_FEEDBACK 122 | REFERRED_BY 123 | } 124 | 125 | enum StandupUserStatus { 126 | ACTIVE 127 | INACTIVE 128 | INVITED 129 | } 130 | 131 | enum TeamStatus { 132 | ACTIVE 133 | DELINQUENT 134 | INACTIVE 135 | } 136 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/datamodel-1col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Eventid { 2 | eventId: String @id 3 | createdAt: DateTime 4 | } 5 | 6 | model Migrate { 7 | version: Int @id 8 | } 9 | 10 | model Post { 11 | id: Int @id @pg.serial("posts_id_seq") 12 | createdAt: DateTime 13 | reports: Report[]? 14 | standup: Standup 15 | updatedAt: DateTime 16 | } 17 | 18 | model Question { 19 | id: Int @id @pg.serial("questions_id_seq") 20 | createdAt: DateTime 21 | order: Int 22 | question: String 23 | standup: Standup 24 | updatedAt: DateTime 25 | } 26 | 27 | model Report { 28 | id: Int @id @pg.serial("reports_id_seq") 29 | createdAt: DateTime 30 | post: Post? 31 | questions: Json 32 | standup: Standup 33 | status: ReportStatus 34 | updatedAt: DateTime 35 | user: User 36 | } 37 | 38 | enum ReportStatus { 39 | Asked = "ASKED" 40 | Complete = "COMPLETE" 41 | Pending = "PENDING" 42 | Skip = "SKIP" 43 | } 44 | 45 | model Review { 46 | id: Int @id @pg.serial("reviews_id_seq") 47 | createdAt: DateTime 48 | text: String 49 | type: ReviewType 50 | user: User 51 | } 52 | 53 | enum ReviewType { 54 | Comment = "COMMENT" 55 | ExitFeedback = "EXIT_FEEDBACK" 56 | ReferredBy = "REFERRED_BY" 57 | } 58 | 59 | model Standup { 60 | id: Int @id @pg.serial("standups_id_seq") 61 | channelId: String 62 | createdAt: DateTime 63 | isThreaded: Boolean @default(false) 64 | name: Citext 65 | posts: Post[] 66 | questions: Question[] 67 | reports: Report[] 68 | standupsUsers: StandupsUser[] 69 | team: Team 70 | time: Time 71 | timezone: String 72 | updatedAt: DateTime 73 | } 74 | 75 | enum StandupUserStatus { 76 | Active = "ACTIVE" 77 | Inactive = "INACTIVE" 78 | Invited = "INVITED" 79 | } 80 | 81 | model StandupUser { 82 | createdAt: DateTime 83 | isStandupOwner: Boolean @default(false) 84 | standup: Standup 85 | status: StandupUserStatus 86 | time: Time 87 | updatedAt: DateTime 88 | user: User 89 | } 90 | 91 | model Team { 92 | id: Int @id @pg.serial("teams_id_seq") 93 | botAccessToken: String @unique 94 | botSlackId: String 95 | costPerUser: Int @default(100) 96 | createdAt: DateTime 97 | minimumMonthlyCost: Int @default(0) 98 | scope: String @default([]) 99 | standups: Standup[] 100 | status: TeamStatus 101 | stripeId: String? 102 | teamAccessToken: String @unique 103 | teamName: String 104 | teamSlackId: String @unique 105 | trialEnds: DateTime 106 | updatedAt: DateTime 107 | users: User[] 108 | } 109 | 110 | enum TeamStatus { 111 | Active = "ACTIVE" 112 | Delinquent = "DELINQUENT" 113 | Inactive = "INACTIVE" 114 | } 115 | 116 | model User { 117 | id: Int @id @pg.serial("users_id_seq") 118 | avatarUrl: String? 119 | createdAt: DateTime 120 | email: String? 121 | firstName: String? 122 | isTeamOwner: Boolean @default(false) 123 | lastName: String? 124 | reports: Report[] 125 | reviews: Review[] 126 | slackId: String 127 | standupsUsers: StandupsUser[] 128 | team: Team 129 | timezone: String 130 | updatedAt: DateTime 131 | username: String 132 | } 133 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/datamodel-2col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Eventid { 2 | eventId: String @id 3 | createdAt: DateTime 4 | } 5 | 6 | model Migrate { 7 | version: Int @id 8 | } 9 | 10 | model Post { 11 | id: Int @id @pg.serial("posts_id_seq") 12 | createdAt: DateTime 13 | reports: Report[]? 14 | standup: Standup 15 | updatedAt: DateTime 16 | } 17 | 18 | model Question { 19 | id: Int @id @pg.serial("questions_id_seq") 20 | createdAt: DateTime 21 | order: Int 22 | question: String 23 | standup: Standup 24 | updatedAt: DateTime 25 | } 26 | 27 | model Report { 28 | id: Int @id @pg.serial("reports_id_seq") 29 | createdAt: DateTime 30 | post: Post? 31 | questions: Json 32 | standup: Standup 33 | status: ReportStatus 34 | updatedAt: DateTime 35 | user: User 36 | } 37 | 38 | enum ReportStatus { 39 | Asked = "ASKED" 40 | Complete = "COMPLETE" 41 | Pending = "PENDING" 42 | Skip = "SKIP" 43 | } 44 | 45 | model Review { 46 | id: Int @id @pg.serial("reviews_id_seq") 47 | createdAt: DateTime 48 | text: String 49 | type: ReviewType 50 | user: User 51 | } 52 | 53 | enum ReviewType { 54 | Comment = "COMMENT" 55 | ExitFeedback = "EXIT_FEEDBACK" 56 | ReferredBy = "REFERRED_BY" 57 | } 58 | 59 | model Standup { 60 | id: Int @id @pg.serial("standups_id_seq") 61 | channelId: String 62 | createdAt: DateTime 63 | isThreaded: Boolean @default(false) 64 | name: Citext 65 | posts: Post[] 66 | questions: Question[] 67 | reports: Report[] 68 | standupsUsers: StandupsUser[] 69 | team: Team 70 | time: Time 71 | timezone: String 72 | updatedAt: DateTime 73 | } 74 | 75 | enum StandupUserStatus { 76 | Active = "ACTIVE" 77 | Inactive = "INACTIVE" 78 | Invited = "INVITED" 79 | } 80 | 81 | model StandupUser { 82 | createdAt: DateTime 83 | isStandupOwner: Boolean @default(false) 84 | standup: Standup 85 | status: StandupUserStatus 86 | time: Time 87 | updatedAt: DateTime 88 | user: User 89 | } 90 | 91 | model Team { 92 | id: Int @id @pg.serial("teams_id_seq") 93 | botAccessToken: String @unique 94 | botSlackId: String 95 | costPerUser: Int @default(100) 96 | createdAt: DateTime 97 | minimumMonthlyCost: Int @default(0) 98 | scope: String @default([]) 99 | standups: Standup[] 100 | status: TeamStatus 101 | stripeId: String? 102 | teamAccessToken: String @unique 103 | teamName: String 104 | teamSlackId: String @unique 105 | trialEnds: DateTime 106 | updatedAt: DateTime 107 | users: User[] 108 | } 109 | 110 | enum TeamStatus { 111 | Active = "ACTIVE" 112 | Delinquent = "DELINQUENT" 113 | Inactive = "INACTIVE" 114 | } 115 | 116 | model User { 117 | id: Int @id @pg.serial("users_id_seq") 118 | avatarUrl: String? 119 | createdAt: DateTime 120 | email: String? 121 | firstName: String? 122 | isTeamOwner: Boolean @default(false) 123 | lastName: String? 124 | reports: Report[] 125 | reviews: Review[] 126 | slackId: String 127 | standupsUsers: StandupsUser[] 128 | team: Team 129 | timezone: String 130 | updatedAt: DateTime 131 | username: String 132 | } 133 | -------------------------------------------------------------------------------- /postgres/standup-slack-bot/datamodel-3col-2.0.groovy: -------------------------------------------------------------------------------- 1 | model Eventid { 2 | eventId String @id 3 | createdAt DateTime 4 | } 5 | 6 | model Migrate { 7 | version Int @id 8 | } 9 | 10 | model Post { 11 | id Int @id @pg.serial("posts_id_seq") 12 | createdAt DateTime 13 | reports Report[]? 14 | standup Standup 15 | updatedAt DateTime 16 | } 17 | 18 | model Question { 19 | id Int @id @pg.serial("questions_id_seq") 20 | createdAt DateTime 21 | order Int 22 | question String 23 | standup Standup 24 | updatedAt DateTime 25 | } 26 | 27 | model Report { 28 | id Int @id @pg.serial("reports_id_seq") 29 | createdAt DateTime 30 | post Post? 31 | questions Json 32 | standup Standup 33 | status ReportStatus 34 | updatedAt DateTime 35 | user User 36 | } 37 | 38 | enum ReportStatus { 39 | Asked = "ASKED" 40 | Complete = "COMPLETE" 41 | Pending = "PENDING" 42 | Skip = "SKIP" 43 | } 44 | 45 | model Review { 46 | id Int @id @pg.serial("reviews_id_seq") 47 | createdAt DateTime 48 | text String 49 | type ReviewType 50 | user User 51 | } 52 | 53 | enum ReviewType { 54 | Comment = "COMMENT" 55 | ExitFeedback = "EXIT_FEEDBACK" 56 | ReferredBy = "REFERRED_BY" 57 | } 58 | 59 | model Standup { 60 | id Int @id @pg.serial("standups_id_seq") 61 | channelId String 62 | createdAt DateTime 63 | isThreaded Boolean @default(false) 64 | name Citext 65 | posts Post[] 66 | questions Question[] 67 | reports Report[] 68 | standupsUsers StandupsUser[] 69 | team Team 70 | time Time 71 | timezone String 72 | updatedAt DateTime 73 | } 74 | 75 | enum StandupUserStatus { 76 | Active = "ACTIVE" 77 | Inactive = "INACTIVE" 78 | Invited = "INVITED" 79 | } 80 | 81 | model StandupUser { 82 | createdAt DateTime 83 | isStandupOwner Boolean @default(false) 84 | standup Standup 85 | status StandupUserStatus 86 | time Time 87 | updatedAt DateTime 88 | user User 89 | } 90 | 91 | model Team { 92 | id Int @id @pg.serial("teams_id_seq") 93 | botAccessToken String @unique 94 | botSlackId String 95 | costPerUser Int @default(100) 96 | createdAt DateTime 97 | minimumMonthlyCost Int @default(0) 98 | scope String @default([]) 99 | standups Standup[] 100 | status TeamStatus 101 | stripeId String? 102 | teamAccessToken String @unique 103 | teamName String 104 | teamSlackId String @unique 105 | trialEnds DateTime 106 | updatedAt DateTime 107 | users User[] 108 | } 109 | 110 | enum TeamStatus { 111 | Active = "ACTIVE" 112 | Delinquent = "DELINQUENT" 113 | Inactive = "INACTIVE" 114 | } 115 | 116 | model User { 117 | id Int @id @pg.serial("users_id_seq") 118 | avatarUrl String? 119 | createdAt DateTime 120 | email String? 121 | firstName String? 122 | isTeamOwner Boolean @default(false) 123 | lastName String? 124 | reports Report[] 125 | reviews Review[] 126 | slackId String 127 | standupsUsers StandupsUser[] 128 | team Team 129 | timezone String 130 | updatedAt DateTime 131 | username String 132 | } 133 | -------------------------------------------------------------------------------- /scripts/docker/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Build script to publish MySQL, Postgres docker images with data. 4 | 5 | MySQL: https://hub.docker.com/repository/docker/divyenduz/mysql-with-data (root password is `prisma`) 6 | Postgres: https://hub.docker.com/repository/docker/divyenduz/postgres-with-data 7 | 8 | The script can be invoked via Github action `workflow_dispatch` 9 | -------------------------------------------------------------------------------- /scripts/docker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOCKER_HUB_USERNAME=divyenduz 4 | 5 | if [ ! -z "$DOCKER_HUB_TOKEN" ]; then 6 | docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_TOKEN" 7 | fi 8 | 9 | set -eu 10 | 11 | (cd docker && docker-compose up -d) 12 | 13 | docker run --rm -v "$PWD":/app treeder/bump --filename scripts/docker/postgresql/VERSION patch 14 | POSTGRES_DOCKER_TAG=$(cat scripts/docker/postgresql/VERSION) 15 | echo "POSTGRES_DOCKER_TAG: $POSTGRES_DOCKER_TAG" 16 | 17 | POSTGRES_IMAGE_NAME=postgres-with-data 18 | npx db-knife --template clean-load --db postgres://root:prisma@127.0.0.1:5432 --folder ./postgres | sh | true 19 | npx db-knife --template before-load --db postgres://root:prisma@127.0.0.1:5432 --folder ./postgres | sh | true 20 | npx db-knife --db postgres://root:prisma@127.0.0.1:5432 --folder ./postgres | sh | true 21 | rm -rf ./scripts/docker/postgresql/data 22 | docker cp docker_postgres_1:/var/lib/postgresql/data ./scripts/docker/postgresql/data 23 | docker build -t $POSTGRES_IMAGE_NAME ./scripts/docker/postgresql 24 | # TODO: Test before tag and push 25 | # docker run -p 5432:5432 $DOCKER_HUB_USERNAME/$POSTGRES_IMAGE_NAME:$POSTGRES_DOCKER_TAG 26 | docker tag $POSTGRES_IMAGE_NAME $DOCKER_HUB_USERNAME/$POSTGRES_IMAGE_NAME:$POSTGRES_DOCKER_TAG 27 | docker push $DOCKER_HUB_USERNAME/$POSTGRES_IMAGE_NAME:$POSTGRES_DOCKER_TAG 28 | 29 | docker run --rm -v "$PWD":/app treeder/bump --filename scripts/docker/mysql/VERSION patch 30 | MYSQL_DOCKER_TAG=$(cat scripts/docker/mysql/VERSION) 31 | echo "MYSQL_DOCKER_TAG: $MYSQL_DOCKER_TAG" 32 | 33 | MYSQL_IMAGE_NAME=mysql-with-data 34 | npx db-knife --template clean-load --db mysql://root:prisma@127.0.0.1:3306 --folder ./mysql | sh | true 35 | npx db-knife --template before-load --db mysql://root:prisma@127.0.0.1:3306 --folder ./mysql | sh | true 36 | npx db-knife --db mysql://root:prisma@127.0.0.1:3306 --folder ./mysql | sh | true 37 | npx db-knife --db mysql://root:prisma@127.0.0.1:3306 --data-only --folder ./mysql | sh | true 38 | rm -rf ./scripts/docker/mysql/data 39 | docker cp docker_mysql_1:/var/lib/mysql ./scripts/docker/mysql/data 40 | docker build -t $MYSQL_IMAGE_NAME ./scripts/docker/mysql 41 | # TODO: Test before tag and push 42 | # docker run -p 3306:3306 $DOCKER_HUB_USERNAME/$MYSQL_IMAGE_NAME:$MYSQL_DOCKER_TAG 43 | docker tag $MYSQL_IMAGE_NAME $DOCKER_HUB_USERNAME/$MYSQL_IMAGE_NAME:$MYSQL_DOCKER_TAG 44 | docker push $DOCKER_HUB_USERNAME/$MYSQL_IMAGE_NAME:$MYSQL_DOCKER_TAG 45 | 46 | (cd docker && docker-compose down) 47 | 48 | if [ ! -z "$CI" ]; then 49 | git add -A 50 | git commit -m "release: docker tag $MYSQL_DOCKER_TAG" 51 | git tag -a "$MYSQL_DOCKER_TAG" -m "version $MYSQL_DOCKER_TAG" 52 | git push 53 | git push --tags 54 | fi 55 | 56 | -------------------------------------------------------------------------------- /scripts/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mysql: 4 | image: mysql:5.7 5 | restart: always 6 | ports: 7 | - "3306:3306" 8 | environment: 9 | MYSQL_ROOT_PASSWORD: prisma 10 | volumes: 11 | - mysql:/var/lib/mysql 12 | postgres: 13 | image: postgres:12 14 | restart: always 15 | ports: 16 | - '5432:5432' 17 | environment: 18 | POSTGRES_USER: root 19 | POSTGRES_PASSWORD: prisma 20 | volumes: 21 | - postgres:/var/lib/postgresql/data 22 | volumes: 23 | mysql: 24 | postgres: 25 | -------------------------------------------------------------------------------- /scripts/docker/mssql/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | sql-server-db: 4 | container_name: sql-server-db 5 | image: mcr.microsoft.com/mssql/server:2019-CU6-ubuntu-16.04 6 | ports: 7 | - "1433:1433" 8 | environment: 9 | - ACCEPT_EULA=Y 10 | - SA_PASSWORD=Prisma1-prisma 11 | volumes: 12 | - ../../../mssql:/var/lib/mssql/data 13 | volumes: 14 | mssql: 15 | -------------------------------------------------------------------------------- /scripts/docker/mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mysql:5.7 2 | ADD VERSION . 3 | 4 | ENV MYSQL_ROOT_HOST='%' 5 | ENV MYSQL_ALLOW_EMPTY_PASSWORD='yes' 6 | COPY ./data /data 7 | COPY ./mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf 8 | -------------------------------------------------------------------------------- /scripts/docker/mysql/VERSION: -------------------------------------------------------------------------------- 1 | 0.0.2 2 | -------------------------------------------------------------------------------- /scripts/docker/mysql/mysqld.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License, version 2.0, 5 | # as published by the Free Software Foundation. 6 | # 7 | # This program is also distributed with certain software (including 8 | # but not limited to OpenSSL) that is licensed under separate terms, 9 | # as designated in a particular file or component or in included license 10 | # documentation. The authors of MySQL hereby grant you an additional 11 | # permission to link the program and your derivative works with the 12 | # separately licensed software that they have included with MySQL. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License, version 2.0, for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | # 24 | # The MySQL Server configuration file. 25 | # 26 | # For explanations see 27 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 28 | 29 | [mysqld] 30 | pid-file = /var/run/mysqld/mysqld.pid 31 | socket = /var/run/mysqld/mysqld.sock 32 | datadir = /data 33 | #datadir = /var/lib/mysql 34 | #log-error = /var/log/mysql/error.log 35 | # By default we only accept connections from localhost 36 | #bind-address = 127.0.0.1 37 | # Disabling symbolic-links is recommended to prevent assorted security risks 38 | symbolic-links=0 39 | -------------------------------------------------------------------------------- /scripts/docker/postgresql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:12 2 | ADD VERSION . 3 | 4 | COPY ./data /data 5 | ENV PGDATA=/data 6 | -------------------------------------------------------------------------------- /scripts/docker/postgresql/VERSION: -------------------------------------------------------------------------------- 1 | 0.0.2 2 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | age Int? 3 | id String @id(strategy: NONE) 4 | } 5 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_compound_primary_key.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_compound_primary_key.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_compound_primary_key.prisma: -------------------------------------------------------------------------------- 1 | model something { 2 | column1 String? @id(strategy: NONE) 3 | column2 String? @id(strategy: NONE) 4 | value String? 5 | 6 | @@unique([column1, column2], name: "sqlite_autoindex_something_1") 7 | } 8 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_default_datetime_now.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_default_datetime_now.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_default_datetime_now.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | date String? 3 | id Int @id 4 | } 5 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_default_values.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_default_values.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_default_values.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | age Int @default(10) 3 | id Int @id 4 | name String @default(""Paul"") 5 | weight Float @default(80.5) 6 | } 7 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_gql_types.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_gql_types.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_gql_types.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | Field3 Float? 3 | age Int? 4 | id String @id(strategy: NONE) 5 | } 6 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_index.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_index.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | Field2 Int? 3 | id Int @id 4 | } 5 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_multi_column_index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_multi_column_index.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_multi_column_index.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | city String? 3 | id Int @id 4 | street String? 5 | zip Int? 6 | } 7 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_multi_column_unique.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_multi_column_unique.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_multi_column_unique.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | firstname String? 3 | id Int @id 4 | lastname String? 5 | 6 | @@unique([firstname, lastname], name: "multi_column_unique_index_name") 7 | } 8 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_optional_and_required_columns.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_optional_and_required_columns.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_optional_and_required_columns.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | Field3 Int? 3 | age Int 4 | id Int @id 5 | } 6 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_optional_primary_key.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_optional_primary_key.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_optional_primary_key.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | id_optional Int? @id 3 | } 4 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_sequence_id.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_sequence_id.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_sequence_id.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | firstname String 3 | id Int? @id 4 | lastname String 5 | } 6 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_unique_with_index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_unique_with_index.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_unique_with_index.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | Field1 Int @id 3 | Field2 Int? @unique 4 | } 5 | -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_unique_without_index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/models/table_with_unique_without_index.db -------------------------------------------------------------------------------- /sqlite/basic_tests/models/table_with_unique_without_index.prisma: -------------------------------------------------------------------------------- 1 | model User { 2 | Field1 Int @id 3 | Field2 Int? @unique 4 | } 5 | -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-1.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/relations/relation_1-1.db -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-1.prisma: -------------------------------------------------------------------------------- 1 | model supplier_groups { 2 | group_id Int? @id 3 | group_name String 4 | suppliers suppliers[] @relation("supplier_groups_suppliers_group_id", references: [group_id]) 5 | } 6 | 7 | model suppliers { 8 | group_id supplier_groups? @relation("supplier_groups_suppliers_group_id") @unique 9 | supplier_id Int? @id 10 | supplier_name String 11 | } 12 | -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-1req.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/relations/relation_1-1req.db -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-1req.prisma: -------------------------------------------------------------------------------- 1 | model supplier_groups { 2 | group_id Int? @id 3 | group_name String 4 | suppliers suppliers[] @relation("supplier_groups_suppliers_group_id", references: [group_id]) 5 | } 6 | 7 | model suppliers { 8 | group_id supplier_groups @relation("supplier_groups_suppliers_group_id") @unique 9 | supplier_id Int? @id 10 | supplier_name String 11 | } 12 | -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-M.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/relations/relation_1-M.db -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1-M.prisma: -------------------------------------------------------------------------------- 1 | model supplier_groups { 2 | group_id Int? @id 3 | group_name String 4 | suppliers suppliers[] @relation("supplier_groups_suppliers_group_id", references: [group_id]) 5 | } 6 | 7 | model suppliers { 8 | group_id supplier_groups? @relation("supplier_groups_suppliers_group_id") 9 | supplier_id Int? @id 10 | supplier_name String 11 | } 12 | -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1req-M.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/basic_tests/relations/relation_1req-M.db -------------------------------------------------------------------------------- /sqlite/basic_tests/relations/relation_1req-M.prisma: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sqlite/openfootball/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://github.com/openfootball/schema.sql 4 | -------------------------------------------------------------------------------- /sqlite/openfootball/schema.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/openfootball/schema.db -------------------------------------------------------------------------------- /sqlite/sample_schemas/Northwind_small.prisma: -------------------------------------------------------------------------------- 1 | model Employee { 2 | Address String? 3 | BirthDate String? 4 | City String? 5 | Country String? 6 | Extension String? 7 | FirstName String? 8 | HireDate String? 9 | HomePhone String? 10 | Id Int? @id 11 | LastName String? 12 | Notes String? 13 | Photo String? 14 | PhotoPath String? 15 | PostalCode String? 16 | Region String? 17 | ReportsTo Int? 18 | Title String? 19 | TitleOfCourtesy String? 20 | } 21 | 22 | model Category { 23 | CategoryName String? 24 | Description String? 25 | Id Int? @id 26 | } 27 | 28 | model Customer { 29 | Address String? 30 | City String? 31 | CompanyName String? 32 | ContactName String? 33 | ContactTitle String? 34 | Country String? 35 | Fax String? 36 | Id String? @id(strategy: NONE) 37 | Phone String? 38 | PostalCode String? 39 | Region String? 40 | } 41 | 42 | model Shipper { 43 | CompanyName String? 44 | Id Int? @id 45 | Phone String? 46 | } 47 | 48 | model Supplier { 49 | Address String? 50 | City String? 51 | CompanyName String? 52 | ContactName String? 53 | ContactTitle String? 54 | Country String? 55 | Fax String? 56 | HomePage String? 57 | Id Int? @id 58 | Phone String? 59 | PostalCode String? 60 | Region String? 61 | } 62 | 63 | model Order { 64 | CustomerId String? 65 | EmployeeId Int 66 | Freight String 67 | Id Int? @id 68 | OrderDate String? 69 | RequiredDate String? 70 | ShipAddress String? 71 | ShipCity String? 72 | ShipCountry String? 73 | ShipName String? 74 | ShipPostalCode String? 75 | ShipRegion String? 76 | ShipVia Int? 77 | ShippedDate String? 78 | } 79 | 80 | model Product { 81 | CategoryId Int 82 | Discontinued Int 83 | Id Int? @id 84 | ProductName String? 85 | QuantityPerUnit String? 86 | ReorderLevel Int 87 | SupplierId Int 88 | UnitPrice String 89 | UnitsInStock Int 90 | UnitsOnOrder Int 91 | } 92 | 93 | model OrderDetail { 94 | Discount Float 95 | Id String? @id(strategy: NONE) 96 | OrderId Int 97 | ProductId Int 98 | Quantity Int 99 | UnitPrice String 100 | } 101 | 102 | model CustomerCustomerDemo { 103 | CustomerTypeId String? 104 | Id String? @id(strategy: NONE) 105 | } 106 | 107 | model CustomerDemographic { 108 | CustomerDesc String? 109 | Id String? @id(strategy: NONE) 110 | } 111 | 112 | model Region { 113 | Id Int? @id 114 | RegionDescription String? 115 | } 116 | 117 | model Territory { 118 | Id String? @id(strategy: NONE) 119 | RegionId Int 120 | TerritoryDescription String? 121 | } 122 | 123 | model EmployeeTerritory { 124 | EmployeeId Int 125 | Id String? @id(strategy: NONE) 126 | TerritoryId String? 127 | } 128 | -------------------------------------------------------------------------------- /sqlite/sample_schemas/Northwind_small.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/sample_schemas/Northwind_small.sqlite -------------------------------------------------------------------------------- /sqlite/sample_schemas/chinook.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/sample_schemas/chinook.db -------------------------------------------------------------------------------- /sqlite/sample_schemas/chinook.prisma: -------------------------------------------------------------------------------- 1 | model albums { 2 | AlbumId Int @id 3 | ArtistId artists @relation("albums_ArtistId_artists") 4 | Title String 5 | trackses tracks[] @relation("albums_tracks_AlbumId", references: [AlbumId]) 6 | } 7 | 8 | model artists { 9 | ArtistId Int @id 10 | Name String? 11 | albumses albums[] @relation("albums_ArtistId_artists") 12 | } 13 | 14 | model customers { 15 | Address String? 16 | City String? 17 | Company String? 18 | Country String? 19 | CustomerId Int @id 20 | Email String 21 | Fax String? 22 | FirstName String 23 | LastName String 24 | Phone String? 25 | PostalCode String? 26 | State String? 27 | SupportRepId employees? @relation("customers_SupportRepId_employees") 28 | invoiceses invoices[] @relation("customers_invoices_CustomerId", references: [CustomerId]) 29 | } 30 | 31 | model employees { 32 | Address String? 33 | BirthDate DateTime? 34 | City String? 35 | Country String? 36 | Email String? 37 | EmployeeId Int @id 38 | Fax String? 39 | FirstName String 40 | HireDate DateTime? 41 | LastName String 42 | Phone String? 43 | PostalCode String? 44 | ReportsTo employees? @relation("employees_employees_ReportsTo") 45 | State String? 46 | Title String? 47 | customerses customers[] @relation("customers_SupportRepId_employees") 48 | employeeses employees[] @relation("employees_employees_ReportsTo") 49 | } 50 | 51 | model genres { 52 | GenreId Int @id 53 | Name String? 54 | trackses tracks[] @relation("genres_tracks_GenreId", references: [GenreId]) 55 | } 56 | 57 | model invoices { 58 | BillingAddress String? 59 | BillingCity String? 60 | BillingCountry String? 61 | BillingPostalCode String? 62 | BillingState String? 63 | CustomerId customers @relation("customers_invoices_CustomerId") 64 | InvoiceDate DateTime 65 | InvoiceId Int @id 66 | Total Float 67 | invoice_itemses invoice_items[] @relation("invoice_items_InvoiceId_invoices") 68 | } 69 | 70 | model invoice_items { 71 | InvoiceId invoices @relation("invoice_items_InvoiceId_invoices") 72 | InvoiceLineId Int @id 73 | Quantity Int 74 | TrackId tracks @relation("invoice_items_TrackId_tracks") 75 | UnitPrice Float 76 | } 77 | 78 | model media_types { 79 | MediaTypeId Int @id 80 | Name String? 81 | trackses tracks[] @relation("media_types_tracks_MediaTypeId", references: [MediaTypeId]) 82 | } 83 | 84 | model playlists { 85 | Name String? 86 | PlaylistId Int @id 87 | playlist_tracks playlist_track[] @relation("playlist_track_PlaylistId_playlists") 88 | } 89 | 90 | model playlist_track { 91 | PlaylistId playlists @id(strategy: NONE) @relation("playlist_track_PlaylistId_playlists") 92 | TrackId tracks @id(strategy: NONE) @relation("playlist_track_TrackId_tracks") 93 | 94 | @@unique([PlaylistId, TrackId], name: "sqlite_autoindex_playlist_track_1") 95 | } 96 | 97 | model tracks { 98 | AlbumId albums? @relation("albums_tracks_AlbumId") 99 | Bytes Int? 100 | Composer String? 101 | GenreId genres? @relation("genres_tracks_GenreId") 102 | MediaTypeId media_types @relation("media_types_tracks_MediaTypeId") 103 | Milliseconds Int 104 | Name String 105 | TrackId Int @id 106 | UnitPrice Float 107 | invoice_itemses invoice_items[] @relation("invoice_items_TrackId_tracks") 108 | playlist_tracks playlist_track[] @relation("playlist_track_TrackId_tracks") 109 | } 110 | 111 | model sqlite_stat1 { 112 | idx String? 113 | stat String? 114 | tbl String? 115 | } 116 | -------------------------------------------------------------------------------- /sqlite/sql-mysteries/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | From: https://github.com/NUKnightLab/sql-mysteries 4 | -------------------------------------------------------------------------------- /sqlite/sql-mysteries/schema.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prisma/database-schema-examples/8cea37d834f3effd6aad53e98c5bc865b4d85335/sqlite/sql-mysteries/schema.db --------------------------------------------------------------------------------