breaking: rename package names to be consistent and under @medusajs scope (#9580)

This commit is contained in:
Harminder Virk
2024-10-16 22:28:09 +05:30
committed by GitHub
parent cc1a25abb2
commit 68560787e5
289 changed files with 483 additions and 474 deletions
@@ -0,0 +1,256 @@
{
"namespaces": ["public"],
"name": "public",
"tables": [
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"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"
},
"address_1": {
"name": "address_1",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"address_2": {
"name": "address_2",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"company": {
"name": "company",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"city": {
"name": "city",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"country_code": {
"name": "country_code",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"phone": {
"name": "phone",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"province": {
"name": "province",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"postal_code": {
"name": "postal_code",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
}
},
"name": "stock_location_address",
"schema": "public",
"indexes": [
{
"keyName": "IDX_stock_location_address_deleted_at",
"columnNames": ["deleted_at"],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_stock_location_address_deleted_at\" ON \"stock_location_address\" (deleted_at) WHERE deleted_at IS NOT NULL"
},
{
"keyName": "stock_location_address_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"
},
"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": {
"name": "name",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"address_id": {
"name": "address_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
}
},
"name": "stock_location",
"schema": "public",
"indexes": [
{
"keyName": "IDX_stock_location_deleted_at",
"columnNames": ["deleted_at"],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_stock_location_deleted_at\" ON \"stock_location\" (deleted_at) WHERE deleted_at IS NOT NULL"
},
{
"keyName": "stock_location_pkey",
"columnNames": ["id"],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"stock_location_address_id_foreign": {
"constraintName": "stock_location_address_id_foreign",
"columnNames": ["address_id"],
"localTableName": "public.stock_location",
"referencedColumnNames": ["id"],
"referencedTableName": "public.stock_location_address",
"deleteRule": "set null",
"updateRule": "cascade"
}
}
}
]
}
@@ -0,0 +1,33 @@
import { Migration } from "@mikro-orm/migrations"
export class Migration20240307161216 extends Migration {
async up(): Promise<void> {
this.addSql(
'create table if not exists "stock_location_address" ("id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "address_1" text not null, "address_2" text null, "company" text null, "city" text null, "country_code" text not null, "phone" text null, "province" text null, "postal_code" text null, "metadata" jsonb null, constraint "stock_location_address_pkey" primary key ("id"));'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_stock_location_address_deleted_at" ON "stock_location_address" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'create table if not exists "stock_location" ("id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "name" text not null, "address_id" text null, "metadata" jsonb null, constraint "stock_location_pkey" primary key ("id"));'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_stock_location_deleted_at" ON "stock_location" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'alter table if exists "stock_location" add constraint "stock_location_address_id_foreign" foreign key ("address_id") references "stock_location_address" ("id") on update cascade on delete set null;'
)
}
async down(): Promise<void> {
this.addSql(
'alter table if exists "stock_location" drop constraint if exists "stock_location_address_id_foreign";'
)
this.addSql('drop table if exists "stock_location_address" cascade;')
this.addSql('drop table if exists "stock_location" cascade;')
}
}