CREATE TABLE "users" (
	"id" TEXT NOT NULL UNIQUE,
	"username" VARCHAR(255) UNIQUE,
	"password" VARCHAR(255),
	PRIMARY KEY("id")
);




CREATE TABLE "post" (
	"id" TEXT NOT NULL UNIQUE,
	"title" TEXT,
	"description" TEXT,
	"content" TEXT,
	"createdAt" TIMESTAMP,
	"updatedAt" TIMESTAMP,
	PRIMARY KEY("id")
);




CREATE TABLE "posts" (
	"id" TEXT NOT NULL UNIQUE,
	"user_id" INTEGER,
	"post_id" INTEGER,
	PRIMARY KEY("id")
);




CREATE TABLE "images" (
	"id" TEXT NOT NULL UNIQUE,
	"path" TEXT,
	PRIMARY KEY("id")
);



ALTER TABLE "users"
ADD FOREIGN KEY("id") REFERENCES "posts"("user_id")
ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE "post"
ADD FOREIGN KEY("id") REFERENCES "posts"("post_id")
ON UPDATE NO ACTION ON DELETE NO ACTION;
