Project structure

The PostgreSQL project has the following structure:

.
├─ EXTENSION
└─ SCHEMA
   ├─ schema_name
   ├─ ...
   └─ another_schema_name
      ├─ another_schema_name.sql
      ├─ DOMAIN
      ├─ FTS_CONFIGURATION
      ├─ FTS_DICTIONARY
      ├─ FTS_PARSER
      ├─ FTS_TEMPLATE
      ├─ FUNCTION
      ├─ OPERATOR
      ├─ PROCEDURE
      ├─ SEQUENCE
      ├─ TABLE
      │  └─ table_name.sql
      ├─ TYPE
      │  └─ type_name.sql
      └─ VIEW
         └─ view_name.sql
  • schema_name … another_schema_name - schema names.

  • another_schema_name.sql - an obligatory file with schema definition, the name should be identical to the directory name.

  • table_name.sql, type_name.sql, view_name.sql - files with objects’ definition. The names are specified without schema names.

  • all the overloaded functions are stored in a single file. For example, the functions public.func(int) and public.func(text) will be located in SCHEMA/public/FUNCTION/func.sql.

  • definition of indexes, constraints, triggers and rules are located in the files of parent objects. For example, index public.ii for the public.t1 table will be located in SCHEMA/public/TABLE/t1.sql.

The MS SQL project has the following structure:

.
├─ Assemblies
├─ Functions
├─ Security
│  ├─ Roles
│  ├─ Schemas
│  │  └─ schema_name.sql
│  └─ Users
├─ Sequences
├─ Stored Procedures
├─ Tables
│  └─ schema_name.table_name.sql
├─ Types
│  └─ schema_name.type_name.sql
└─ Views
   └─ schema_name.view_name.sql
  • schema_name.sql - an obligatory file with schema definition.

  • schema_name.table_name.sql, schema_name.type_name.sql, schema_name.view_name.sql - files with object definitions объектов. Names are specified with the schema name.

  • definitions of indexes, constraints, triggers are located in the files of parent objects. For example, index dbo.ii for the dbo.t1 table will be located in Tables/dbo.t1.sql.

Apart from this, a project may contain the following directories:

MIGRATION. Contains the saved migration scripts. You can select automatic save and deletion of migration scripts for this directory on the settings page DB update.

OVERRIDES. Contains files of object properties override. The inner structure of this directory duplicates the project structure. You can save the properties override by selecting the corresponding item while saving the objects in the project. Overriding privileges and owners of database objects is currently supported.