You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
senzapaura_es/drizzle/0028_serious_anita_blake.sql

20 lines
1.4 KiB

ALTER TABLE "artista" ADD COLUMN "presentacion" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "album" ADD COLUMN "secciones" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "album" ADD COLUMN "presentacion" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "cancion" ADD COLUMN "presentacion" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "entrada" ADD COLUMN "presentacion" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
UPDATE "album"
SET "secciones" = jsonb_build_array(
jsonb_build_object(
'id', 'texto-principal',
'tipo', 'texto',
'texto', "cuerpo"
)
)
WHERE btrim("cuerpo") <> '';--> statement-breakpoint
ALTER TABLE "artista" ADD CONSTRAINT "artista_presentacion_objeto" CHECK (jsonb_typeof("artista"."presentacion") = 'object');--> statement-breakpoint
ALTER TABLE "album" ADD CONSTRAINT "album_secciones_array" CHECK (jsonb_typeof("album"."secciones") = 'array');--> statement-breakpoint
ALTER TABLE "album" ADD CONSTRAINT "album_presentacion_objeto" CHECK (jsonb_typeof("album"."presentacion") = 'object');--> statement-breakpoint
ALTER TABLE "cancion" ADD CONSTRAINT "cancion_presentacion_objeto" CHECK (jsonb_typeof("cancion"."presentacion") = 'object');--> statement-breakpoint
ALTER TABLE "entrada" ADD CONSTRAINT "entrada_presentacion_objeto" CHECK (jsonb_typeof("entrada"."presentacion") = 'object');

Powered by TurnKey Linux.