/*
 Navicat Premium Data Transfer

 Source Server         : anjabbawah
 Source Server Type    : PostgreSQL
 Source Server Version : 150003 (150003)
 Source Host           : localhost:5432
 Source Catalog        : sppai
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 150003 (150003)
 File Encoding         : 65001

 Date: 21/04/2026 10:58:43
*/


-- ----------------------------
-- Table structure for abc_activity_allocations
-- ----------------------------
DROP TABLE IF EXISTS "public"."abc_activity_allocations";
CREATE TABLE "public"."abc_activity_allocations" (
  "id" int8 NOT NULL DEFAULT nextval('abc_activity_allocations_id_seq'::regclass),
  "year_id" int4 NOT NULL,
  "activity_id" int4 NOT NULL,
  "driver_id" int4 NOT NULL,
  "study_program_id" int4 NOT NULL,
  "driver_value" numeric(10,2) NOT NULL DEFAULT 0,
  "cost_amount" numeric(15,2) NOT NULL DEFAULT 0,
  "created_at" timestamp(6),
  "updated_at" timestamp(6)
)
;

-- ----------------------------
-- Records of abc_activity_allocations
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table abc_activity_allocations
-- ----------------------------
ALTER TABLE "public"."abc_activity_allocations" ADD CONSTRAINT "pk_abc_activity_allocations" PRIMARY KEY ("id");

-- ----------------------------
-- Foreign Keys structure for table abc_activity_allocations
-- ----------------------------
ALTER TABLE "public"."abc_activity_allocations" ADD CONSTRAINT "abc_activity_allocations_activity_id_foreign" FOREIGN KEY ("activity_id") REFERENCES "public"."abc_activities" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE "public"."abc_activity_allocations" ADD CONSTRAINT "abc_activity_allocations_study_program_id_foreign" FOREIGN KEY ("study_program_id") REFERENCES "public"."ms_study_programs" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE "public"."abc_activity_allocations" ADD CONSTRAINT "abc_activity_allocations_year_id_foreign" FOREIGN KEY ("year_id") REFERENCES "public"."ms_academic_years" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
