ALTER TABLE items
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-10-30 00:11:25 +02:00
parent 3365b38e5a
commit 43472a64e7
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -50,13 +50,23 @@ CREATE TABLE IF NOT EXISTS "items" (
"channel_id" int references "channels" on delete cascade, "channel_id" int references "channels" on delete cascade,
"uid" varchar(512) not null unique, "uid" varchar(512) not null unique,
"is_read" int default 0, "is_read" int default 0,
"data" json, "data" jsonb,
"created_at" timestamp DEFAULT current_timestamp, "created_at" timestamp DEFAULT current_timestamp,
"updated_at" timestamp, "updated_at" timestamp,
"published_at" timestamp "published_at" timestamp
); );
`) `)
if err != nil { if err != nil {
_, err = conn.ExecContext(ctx, `
ALTER TABLE "items"
ALTER COLUMN "data" TYPE jsonb
ALTER COLUMN "uid" TYPE varchar(1024);
);
`)
if err != nil {
return fmt.Errorf("create items table failed: %w", err)
}
return fmt.Errorf("create items table failed: %w", err) return fmt.Errorf("create items table failed: %w", err)
} }