{
  "namespaces": [
    "public"
  ],
  "name": "public",
  "tables": [
    {
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "item_line_id": {
          "name": "item_line_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "rule_id": {
          "name": "rule_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "currency_code": {
          "name": "currency_code",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "value": {
          "name": "value",
          "type": "numeric",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "decimal"
        },
        "raw_value": {
          "name": "raw_value",
          "type": "jsonb",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "json"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "deleted_at": {
          "name": "deleted_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "length": 6,
          "mappedType": "datetime"
        }
      },
      "name": "commission_line",
      "schema": "public",
      "indexes": [
        {
          "keyName": "IDX_commission_line_deleted_at",
          "columnNames": [],
          "composite": false,
          "primary": false,
          "unique": false,
          "expression": "CREATE INDEX IF NOT EXISTS \"IDX_commission_line_deleted_at\" ON \"commission_line\" (deleted_at) WHERE deleted_at IS NULL"
        },
        {
          "keyName": "commission_line_pkey",
          "columnNames": [
            "id"
          ],
          "composite": false,
          "primary": true,
          "unique": true
        }
      ],
      "checks": [],
      "foreignKeys": {}
    },
    {
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "name": {
          "name": "name",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "reference": {
          "name": "reference",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "reference_id": {
          "name": "reference_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "default": "true",
          "mappedType": "boolean"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "deleted_at": {
          "name": "deleted_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "length": 6,
          "mappedType": "datetime"
        }
      },
      "name": "commission_rule",
      "schema": "public",
      "indexes": [
        {
          "keyName": "IDX_commission_rule_deleted_at",
          "columnNames": [],
          "composite": false,
          "primary": false,
          "unique": false,
          "expression": "CREATE INDEX IF NOT EXISTS \"IDX_commission_rule_deleted_at\" ON \"commission_rule\" (deleted_at) WHERE deleted_at IS NULL"
        },
        {
          "keyName": "commission_rule_pkey",
          "columnNames": [
            "id"
          ],
          "composite": false,
          "primary": true,
          "unique": true
        }
      ],
      "checks": [],
      "foreignKeys": {}
    },
    {
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "type": {
          "name": "type",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "text"
        },
        "percentage_rate": {
          "name": "percentage_rate",
          "type": "integer",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "mappedType": "integer"
        },
        "include_tax": {
          "name": "include_tax",
          "type": "boolean",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "mappedType": "boolean"
        },
        "price_set_id": {
          "name": "price_set_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "mappedType": "text"
        },
        "max_price_set_id": {
          "name": "max_price_set_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "mappedType": "text"
        },
        "min_price_set_id": {
          "name": "min_price_set_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "mappedType": "text"
        },
        "rule_id": {
          "name": "rule_id",
          "type": "text",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "mappedType": "text"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": false,
          "length": 6,
          "default": "now()",
          "mappedType": "datetime"
        },
        "deleted_at": {
          "name": "deleted_at",
          "type": "timestamptz",
          "unsigned": false,
          "autoincrement": false,
          "primary": false,
          "nullable": true,
          "length": 6,
          "mappedType": "datetime"
        }
      },
      "name": "commission_rate",
      "schema": "public",
      "indexes": [
        {
          "columnNames": [
            "rule_id"
          ],
          "composite": false,
          "keyName": "commission_rate_rule_id_unique",
          "primary": false,
          "unique": true
        },
        {
          "keyName": "IDX_commission_rate_rule_id",
          "columnNames": [],
          "composite": false,
          "primary": false,
          "unique": false,
          "expression": "CREATE INDEX IF NOT EXISTS \"IDX_commission_rate_rule_id\" ON \"commission_rate\" (rule_id) WHERE deleted_at IS NULL"
        },
        {
          "keyName": "IDX_commission_rate_deleted_at",
          "columnNames": [],
          "composite": false,
          "primary": false,
          "unique": false,
          "expression": "CREATE INDEX IF NOT EXISTS \"IDX_commission_rate_deleted_at\" ON \"commission_rate\" (deleted_at) WHERE deleted_at IS NULL"
        },
        {
          "keyName": "commission_rate_pkey",
          "columnNames": [
            "id"
          ],
          "composite": false,
          "primary": true,
          "unique": true
        }
      ],
      "checks": [],
      "foreignKeys": {
        "commission_rate_rule_id_foreign": {
          "constraintName": "commission_rate_rule_id_foreign",
          "columnNames": [
            "rule_id"
          ],
          "localTableName": "public.commission_rate",
          "referencedColumnNames": [
            "id"
          ],
          "referencedTableName": "public.commission_rule",
          "deleteRule": "set null",
          "updateRule": "cascade"
        }
      }
    }
  ]
}
