CREATE TABLE "users" (
    "id" BIGSERIAL PRIMARY KEY,
    "email" TEXT,
    "phoneNumber" TEXT,
    "password" TEXT,
    "name" TEXT,
    "userTypeCode" TEXT,
    "primaryRole" TEXT,
    "instituteCode" TEXT,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC
);
CREATE TABLE "user_type" (
    "id" BIGSERIAL PRIMARY KEY,
    "userTypeCode" TEXT,
    "userTypeName" TEXT,
    "userTypeDesc" TEXT,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC
);
CREATE TABLE "user_additional_details" (
    "id" BIGSERIAL PRIMARY KEY,
    "userId" BIGINT,
    "addlDataType" TEXT,
    "addlDataName" TEXT,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC,
);
CREATE TABLE "roles_ref" (
    "id" BIGSERIAL PRIMARY KEY,
    "appCode" TEXT,
    "roleCode" TEXT,
    "roleName" TEXT,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC
);
CREATE TABLE "institute" (
    "id" BIGSERIAL PRIMARY KEY,
    "instituteCode" TEXT,
    "instituteName" TEXT,
    "address" TEXT,
    "lat" NUMERIC,
    "lng" NUMERIC,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC
);
CREATE TABLE "subscription" (
    "id" BIGSERIAL PRIMARY KEY,
    "user_id" BIGINT,
    "plan_type" TEXT,
    "start_date" DATE,
    "end_date" DATE,
    "is_active" BOOLEAN,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC,
);

CREATE TABLE "refresh_tokens" (
    "id" BIGSERIAL PRIMARY KEY,
    "email" UNIQUE TEXT,
    "token" TEXT,
    "status" TEXT,
    "validFrom" DATE,
    "validTill" DATE,
    "createdAt" DATE,
    "updatedAt" DATE,
    "createBy" TEXT,
    "modifiedBy" TEXT,
    "deletedAt" DATE,
    "version" NUMERIC,
);
