diff --git a/metadata/tables.yaml b/metadata/tables.yaml index 823defc..25850db 100644 --- a/metadata/tables.yaml +++ b/metadata/tables.yaml @@ -1234,6 +1234,12 @@ _lt: "2022-10-05T23:59:59+08:00" - created_at: _gt: "2022-10-01T00:00:00+08:00" +- table: + name: honor_time + schema: public +- table: + name: honor_type + schema: public - table: name: info_notice schema: public @@ -1849,6 +1855,9 @@ _eq: X-Hasura-User-Id - to_id: _eq: X-Hasura-User-Id +- table: + name: mentor_time + schema: public - table: name: postgraduate_application schema: public diff --git a/migrations/1708227767602_create_table_public_honor_time/down.sql b/migrations/1708227767602_create_table_public_honor_time/down.sql new file mode 100644 index 0000000..449353b --- /dev/null +++ b/migrations/1708227767602_create_table_public_honor_time/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."honor_time"; diff --git a/migrations/1708227767602_create_table_public_honor_time/up.sql b/migrations/1708227767602_create_table_public_honor_time/up.sql new file mode 100644 index 0000000..e01630f --- /dev/null +++ b/migrations/1708227767602_create_table_public_honor_time/up.sql @@ -0,0 +1 @@ +CREATE TABLE "public"."honor_time" ("start_A" timestamptz NOT NULL, "end_A" timestamptz NOT NULL, "start_B" date NOT NULL DEFAULT now(), "end_B" date NOT NULL DEFAULT now(), PRIMARY KEY ("start_A") );COMMENT ON TABLE "public"."honor_time" IS E'荣誉申请时间表'; diff --git a/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/down.sql b/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/down.sql new file mode 100644 index 0000000..701069b --- /dev/null +++ b/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/down.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "end_B" TYPE date; diff --git a/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/up.sql b/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/up.sql new file mode 100644 index 0000000..0b875e6 --- /dev/null +++ b/migrations/1708227840355_alter_table_public_honor_time_alter_column_end_B/up.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "end_B" TYPE timestamptz; diff --git a/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/down.sql b/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/down.sql new file mode 100644 index 0000000..7203481 --- /dev/null +++ b/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/down.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "start_B" TYPE date; diff --git a/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/up.sql b/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/up.sql new file mode 100644 index 0000000..54ff328 --- /dev/null +++ b/migrations/1708227843053_alter_table_public_honor_time_alter_column_start_B/up.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "start_B" TYPE timestamptz; diff --git a/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/down.sql b/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/down.sql new file mode 100644 index 0000000..fa8196a --- /dev/null +++ b/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/down.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "start_A" drop default; diff --git a/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/up.sql b/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/up.sql new file mode 100644 index 0000000..7ac392c --- /dev/null +++ b/migrations/1708227887322_alter_table_public_honor_time_alter_column_start_A/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_time" alter column "start_A" set default now(); diff --git a/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/down.sql b/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/down.sql new file mode 100644 index 0000000..95c2858 --- /dev/null +++ b/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/down.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "end_A" drop default; diff --git a/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/up.sql b/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/up.sql new file mode 100644 index 0000000..fd9293e --- /dev/null +++ b/migrations/1708227893216_alter_table_public_honor_time_alter_column_end_A/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_time" alter column "end_A" set default now(); diff --git a/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/down.sql b/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/down.sql new file mode 100644 index 0000000..2e9656a --- /dev/null +++ b/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."honor_time" add column "activateIn" Integer +-- not null unique default '2024'; diff --git a/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/up.sql b/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/up.sql new file mode 100644 index 0000000..48e3298 --- /dev/null +++ b/migrations/1708228618883_alter_table_public_honor_time_add_column_activateIn/up.sql @@ -0,0 +1,2 @@ +alter table "public"."honor_time" add column "activateIn" Integer + not null unique default '2024'; diff --git a/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/down.sql b/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/down.sql new file mode 100644 index 0000000..702ebc3 --- /dev/null +++ b/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/down.sql @@ -0,0 +1 @@ +alter table "public"."honor_time" alter column "activateIn" set default '2024'; diff --git a/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/up.sql b/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/up.sql new file mode 100644 index 0000000..10c3f50 --- /dev/null +++ b/migrations/1708228637418_alter_table_public_honor_time_alter_column_activateIn/up.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."honor_time" ALTER COLUMN "activateIn" drop default; diff --git a/migrations/1708229305147_modify_primarykey_public_honor_time/down.sql b/migrations/1708229305147_modify_primarykey_public_honor_time/down.sql new file mode 100644 index 0000000..f6a2e6f --- /dev/null +++ b/migrations/1708229305147_modify_primarykey_public_honor_time/down.sql @@ -0,0 +1,4 @@ +alter table "public"."honor_time" drop constraint "honor_time_pkey"; +alter table "public"."honor_time" + add constraint "honor_time_pkey" + primary key ("start_A"); diff --git a/migrations/1708229305147_modify_primarykey_public_honor_time/up.sql b/migrations/1708229305147_modify_primarykey_public_honor_time/up.sql new file mode 100644 index 0000000..80d858c --- /dev/null +++ b/migrations/1708229305147_modify_primarykey_public_honor_time/up.sql @@ -0,0 +1,6 @@ +BEGIN TRANSACTION; +ALTER TABLE "public"."honor_time" DROP CONSTRAINT "honor_time_pkey"; + +ALTER TABLE "public"."honor_time" + ADD CONSTRAINT "honor_time_pkey" PRIMARY KEY ("activateIn"); +COMMIT TRANSACTION; diff --git a/migrations/1708232425927_create_table_public_mentor_time/down.sql b/migrations/1708232425927_create_table_public_mentor_time/down.sql new file mode 100644 index 0000000..1912aa6 --- /dev/null +++ b/migrations/1708232425927_create_table_public_mentor_time/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."mentor_time"; diff --git a/migrations/1708232425927_create_table_public_mentor_time/up.sql b/migrations/1708232425927_create_table_public_mentor_time/up.sql new file mode 100644 index 0000000..50bb783 --- /dev/null +++ b/migrations/1708232425927_create_table_public_mentor_time/up.sql @@ -0,0 +1 @@ +CREATE TABLE "public"."mentor_time" ("start_A" timestamptz NOT NULL DEFAULT now(), "end_A" timestamptz NOT NULL DEFAULT now(), "start_B" timestamptz NOT NULL DEFAULT now(), "end_B" timestamptz NOT NULL DEFAULT now(), "start_C" timestamptz NOT NULL DEFAULT now(), "end_C" timestamptz NOT NULL DEFAULT now(), "start_D" timestamptz NOT NULL DEFAULT now(), "end_D" timestamptz NOT NULL DEFAULT now(), "start_E" timestamptz NOT NULL DEFAULT now(), "end_E" timestamptz NOT NULL DEFAULT now(), "activateIn" integer NOT NULL, PRIMARY KEY ("activateIn") , UNIQUE ("activateIn"));COMMENT ON TABLE "public"."mentor_time" IS E'导师申请时间表'; diff --git a/migrations/1708233267425_create_table_public_honor_type/down.sql b/migrations/1708233267425_create_table_public_honor_type/down.sql new file mode 100644 index 0000000..853f046 --- /dev/null +++ b/migrations/1708233267425_create_table_public_honor_type/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."honor_type"; diff --git a/migrations/1708233267425_create_table_public_honor_type/up.sql b/migrations/1708233267425_create_table_public_honor_type/up.sql new file mode 100644 index 0000000..11bfa00 --- /dev/null +++ b/migrations/1708233267425_create_table_public_honor_type/up.sql @@ -0,0 +1 @@ +CREATE TABLE "public"."honor_type" ("type_id" serial NOT NULL, "type_name" text NOT NULL, PRIMARY KEY ("type_name") , UNIQUE ("type_id"), UNIQUE ("type_name"));COMMENT ON TABLE "public"."honor_type" IS E'荣誉类别'; diff --git a/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/down.sql b/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/down.sql new file mode 100644 index 0000000..43092a3 --- /dev/null +++ b/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/down.sql @@ -0,0 +1,5 @@ +comment on column "public"."honor_type"."type_id" is E'荣誉类别'; +alter table "public"."honor_type" alter column "type_id" set default nextval('honor_type_type_id_seq'::regclass); +alter table "public"."honor_type" add constraint "honor_type_type_id_key" unique (type_id); +alter table "public"."honor_type" alter column "type_id" drop not null; +alter table "public"."honor_type" add column "type_id" int4; diff --git a/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/up.sql b/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/up.sql new file mode 100644 index 0000000..c1db953 --- /dev/null +++ b/migrations/1708233372333_alter_table_public_honor_type_drop_column_type_id/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_type" drop column "type_id" cascade;