mirror of
https://github.com/openziti/zrok.git
synced 2025-02-17 02:30:50 +01:00
add migration for timestamp->timestamptz for postgres (#33)
This commit is contained in:
parent
477ff0f031
commit
cc80b0e860
@ -8,8 +8,8 @@ create table accounts (
|
||||
email varchar(1024) not null unique,
|
||||
password char(128) not null,
|
||||
token varchar(32) not null unique,
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
created_at timestamp not null default(current_timestamp),
|
||||
updated_at timestamp not null default(current_timestamp),
|
||||
|
||||
constraint chk_email check (email <> ''),
|
||||
constraint chk_password check (password <> ''),
|
||||
@ -24,8 +24,8 @@ create table account_requests (
|
||||
token varchar(32) not null unique,
|
||||
email varchar(1024) not null unique,
|
||||
source_address varchar(64) not null,
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp)
|
||||
created_at timestamp not null default(current_timestamp),
|
||||
updated_at timestamp not null default(current_timestamp)
|
||||
);
|
||||
|
||||
--
|
||||
@ -38,8 +38,8 @@ create table environments (
|
||||
host varchar(256),
|
||||
address varchar(64),
|
||||
z_id varchar(32) not null unique,
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
created_at timestamp not null default(current_timestamp),
|
||||
updated_at timestamp not null default(current_timestamp),
|
||||
|
||||
constraint chk_z_id check (z_id <> '')
|
||||
);
|
||||
@ -54,8 +54,8 @@ create table services (
|
||||
name varchar(32) not null unique,
|
||||
frontend varchar(1024),
|
||||
backend varchar(1024),
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
created_at timestamp not null default(current_timestamp),
|
||||
updated_at timestamp not null default(current_timestamp),
|
||||
|
||||
constraint chk_z_id check (z_id <> ''),
|
||||
constraint chk_name check (name <> '')
|
||||
|
13
controller/store/sql/postgresql/001_timestamptz.sql
Normal file
13
controller/store/sql/postgresql/001_timestamptz.sql
Normal file
@ -0,0 +1,13 @@
|
||||
-- +migrate Up
|
||||
|
||||
alter table accounts alter column created_at type timestamptz;
|
||||
alter table accounts alter column updated_at type timestamptz;
|
||||
|
||||
alter table account_requests alter column created_at type timestamptz;
|
||||
alter table account_requests alter column updated_at type timestamptz;
|
||||
|
||||
alter table environments alter column created_at type timestamptz;
|
||||
alter table environments alter column updated_at type timestamptz;
|
||||
|
||||
alter table services alter column created_at type timestamptz;
|
||||
alter table services alter column updated_at type timestamptz;
|
Loading…
Reference in New Issue
Block a user