rosariosis.sql 160 KB
Newer Older
Octopus in vitro's avatar
Octopus in vitro committed
1 2 3
--
-- PostgreSQL database dump
--
4 5
-- Note: Uncheck "Paginate results" when importing with phpPgAdmin
--
Octopus in vitro's avatar
Octopus in vitro committed
6 7 8 9 10

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

-- Fix #102 error language "plpgsql" does not exist
-- http://timmurphy.org/2011/08/27/create-language-if-it-doesnt-exist-in-postgresql/
--
-- Name: create_language_plpgsql(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION create_language_plpgsql()
RETURNS BOOLEAN AS $$
    CREATE LANGUAGE plpgsql;
    SELECT TRUE;
$$ LANGUAGE SQL;

SELECT CASE WHEN NOT
    (
        SELECT  TRUE AS exists
        FROM    pg_language
        WHERE   lanname = 'plpgsql'
        UNION
        SELECT  FALSE AS exists
        ORDER BY exists DESC
        LIMIT 1
    )
THEN
    create_language_plpgsql()
ELSE
    FALSE
END AS plpgsql_created;

DROP FUNCTION create_language_plpgsql();


Octopus in vitro's avatar
Octopus in vitro committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
--modif Francois: fix calc_cum_cr_gpa()
--
-- Name: calc_cum_cr_gpa(character varying, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION calc_cum_cr_gpa(character varying, integer) RETURNS integer
    LANGUAGE plpgsql
    AS $_$DECLARE
  mp_id ALIAS for $1;
  s_id ALIAS for $2;
  mpinfo marking_periods%ROWTYPE;
  s student_mp_stats%ROWTYPE;
BEGIN
    UPDATE student_mp_stats
    SET cum_cr_weighted_factor = cr_weighted_factors/cr_credits,
        cum_cr_unweighted_factor = cr_unweighted_factors/cr_credits
59
    WHERE student_mp_stats.student_id = s_id and cast(student_mp_stats.marking_period_id as text) = mp_id;
Octopus in vitro's avatar
Octopus in vitro committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
  RETURN 1;
END;
$_$;


--modif Francois: fix calc_cum_gpa()
--
-- Name: calc_cum_gpa(character varying, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION calc_cum_gpa(character varying, integer) RETURNS integer
    LANGUAGE plpgsql
    AS $_$DECLARE
  mp_id ALIAS for $1;
  s_id ALIAS for $2;
  mpinfo marking_periods%ROWTYPE;
  s student_mp_stats%ROWTYPE;
BEGIN
    UPDATE student_mp_stats
    SET cum_weighted_factor = sum_weighted_factors/gp_credits,
        cum_unweighted_factor = sum_unweighted_factors/gp_credits
81
    WHERE student_mp_stats.student_id = s_id and cast(student_mp_stats.marking_period_id as text) = mp_id;
Octopus in vitro's avatar
Octopus in vitro committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
  RETURN 1;
END;
$_$;


--modif Francois: fix calc_gpa_mp() + credit()
--
-- Name: calc_gpa_mp(integer, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE OR REPLACE FUNCTION calc_gpa_mp(integer, character varying) RETURNS integer
    AS $_$
DECLARE
  s_id ALIAS for $1;
  mp_id ALIAS for $2;
  oldrec student_mp_stats%ROWTYPE;
BEGIN
  SELECT * INTO oldrec FROM student_mp_stats WHERE student_id = s_id and cast(marking_period_id as text) = mp_id;

  IF FOUND THEN
102 103 104
    UPDATE STUDENT_MP_STATS SET
        sum_weighted_factors = rcg.sum_weighted_factors,
        sum_unweighted_factors = rcg.sum_unweighted_factors,
Octopus in vitro's avatar
Octopus in vitro committed
105 106 107 108
        cr_weighted_factors = rcg.cr_weighted,
        cr_unweighted_factors = rcg.cr_unweighted,
        gp_credits = rcg.gp_credits,
        cr_credits = rcg.cr_credits
109

Octopus in vitro's avatar
Octopus in vitro committed
110
      FROM (
111 112 113
      select
        sum(weighted_gp*credit_attempted/gp_scale) as sum_weighted_factors,
        sum(unweighted_gp*credit_attempted/gp_scale) as sum_unweighted_factors,
Octopus in vitro's avatar
Octopus in vitro committed
114 115 116 117 118 119 120
        sum(credit_attempted) as gp_credits,
        sum( case when class_rank = 'Y' THEN weighted_gp*credit_attempted/gp_scale END ) as cr_weighted,
        sum( case when class_rank = 'Y' THEN unweighted_gp*credit_attempted/gp_scale END ) as cr_unweighted,
        sum( case when class_rank = 'Y' THEN credit_attempted END) as cr_credits

        from student_report_card_grades where student_id = s_id
        and cast(marking_period_id as text) = mp_id
Octopus in vitro's avatar
Octopus in vitro committed
121
         and not gp_scale = 0 group by student_id, marking_period_id
Octopus in vitro's avatar
Octopus in vitro committed
122 123 124 125 126 127
        ) as rcg
WHERE student_id = s_id and cast(marking_period_id as text) = mp_id;
    RETURN 1;
  ELSE
    INSERT INTO STUDENT_MP_STATS (student_id, marking_period_id, sum_weighted_factors, sum_unweighted_factors, grade_level_short, cr_weighted_factors, cr_unweighted_factors, gp_credits, cr_credits)

128 129 130 131
        select
            srcg.student_id, (srcg.marking_period_id::text)::int,
            sum(weighted_gp*credit_attempted/gp_scale) as sum_weighted_factors,
            sum(unweighted_gp*credit_attempted/gp_scale) as sum_unweighted_factors,
132 133 134 135 136 137 138 139 140
            (select eg.short_name
                from enroll_grade eg, marking_periods mp
                where eg.student_id = s_id
                and eg.syear = mp.syear
                and eg.school_id = mp.school_id
                and eg.start_date <= mp.end_date
                and cast(mp.marking_period_id as text) = mp_id
                order by eg.start_date desc
                limit 1),
Octopus in vitro's avatar
Octopus in vitro committed
141
            sum( case when class_rank = 'Y' THEN weighted_gp*credit_attempted/gp_scale END ) as cr_weighted,
142
            sum( case when class_rank = 'Y' THEN unweighted_gp*credit_attempted/gp_scale END ) as cr_unweighted,
Octopus in vitro's avatar
Octopus in vitro committed
143 144
            sum(credit_attempted) as gp_credits,
            sum(case when class_rank = 'Y' THEN credit_attempted END) as cr_credits
145
        from student_report_card_grades srcg
146
        where srcg.student_id = s_id and cast(srcg.marking_period_id as text) = mp_id and not srcg.gp_scale = 0
147
        group by srcg.student_id, srcg.marking_period_id, short_name;
Octopus in vitro's avatar
Octopus in vitro committed
148 149 150 151 152 153 154 155 156 157 158 159 160 161
  END IF;
  RETURN 0;
END
$_$
    LANGUAGE plpgsql;


--
-- Name: credit(integer, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE OR REPLACE FUNCTION credit(integer, character varying) RETURNS numeric
    AS $_$
DECLARE
162 163 164
    course_detail RECORD;
    mp_detail RECORD;
    values RECORD;
165

Octopus in vitro's avatar
Octopus in vitro committed
166 167 168 169 170
BEGIN
select * into course_detail from course_periods where course_period_id = $1;
select * into mp_detail from marking_periods where cast(marking_period_id as text) = $2;

IF course_detail.marking_period_id = mp_detail.marking_period_id THEN
171
    return course_detail.credits;
Octopus in vitro's avatar
Octopus in vitro committed
172
ELSIF course_detail.mp = 'FY' AND mp_detail.mp_type = 'semester' THEN
173
    select into values count(*) as mp_count from marking_periods where parent_id = course_detail.marking_period_id group by parent_id;
Octopus in vitro's avatar
Octopus in vitro committed
174
ELSIF course_detail.mp = 'FY' and mp_detail.mp_type = 'quarter' THEN
175
    select into values count(*) as mp_count from marking_periods where grandparent_id = course_detail.marking_period_id group by grandparent_id;
Octopus in vitro's avatar
Octopus in vitro committed
176
ELSIF course_detail.mp = 'SEM' and mp_detail.mp_type = 'quarter' THEN
177
    select into values count(*) as mp_count from marking_periods where parent_id = course_detail.marking_period_id group by parent_id;
Octopus in vitro's avatar
Octopus in vitro committed
178
ELSE
179
    return course_detail.credits;
Octopus in vitro's avatar
Octopus in vitro committed
180 181 182
END IF;

IF values.mp_count > 0 THEN
183
    return course_detail.credits/values.mp_count;
Octopus in vitro's avatar
Octopus in vitro committed
184
ELSE
185
    return course_detail.credits;
Octopus in vitro's avatar
Octopus in vitro committed
186 187 188 189 190 191 192 193 194 195 196 197
END IF;

END$_$
    LANGUAGE plpgsql;

--modif Francois: fix set_class_rank_mp()
--
-- Name: set_class_rank_mp(character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE OR REPLACE FUNCTION set_class_rank_mp(character varying) RETURNS integer
    AS $_$
198
DECLARE
199
    mp_id alias for $1;
Octopus in vitro's avatar
Octopus in vitro committed
200
BEGIN
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
update student_mp_stats
set cum_rank = rank.rank, class_size = rank.class_size
from (select mp.marking_period_id, sgm.student_id,
    (select count(*)+1
        from student_mp_stats sgm3
        where sgm3.cum_cr_weighted_factor > sgm.cum_cr_weighted_factor
        and sgm3.marking_period_id = mp.marking_period_id
        and sgm3.student_id in (select distinct sgm2.student_id
            from student_mp_stats sgm2, student_enrollment se2
            where sgm2.student_id = se2.student_id
            and sgm2.marking_period_id = mp.marking_period_id
            and se2.grade_id = se.grade_id)) as rank,
    (select count(*)
        from student_mp_stats sgm4
        where sgm4.marking_period_id = mp.marking_period_id
        and sgm4.student_id in (select distinct sgm5.student_id
            from student_mp_stats sgm5, student_enrollment se3
            where sgm5.student_id = se3.student_id
            and sgm5.marking_period_id = mp.marking_period_id
            and se3.grade_id = se.grade_id)) as class_size
    from student_enrollment se, student_mp_stats sgm, marking_periods mp
    where se.student_id = sgm.student_id
    and sgm.marking_period_id = mp.marking_period_id
    and cast(mp.marking_period_id as text) = mp_id
    and se.syear = mp.syear
    and not sgm.cum_cr_weighted_factor is null) as rank
Octopus in vitro's avatar
Octopus in vitro committed
227 228 229 230 231 232 233 234 235 236 237 238
where student_mp_stats.marking_period_id = rank.marking_period_id
and student_mp_stats.student_id = rank.student_id;
RETURN 1;
END;
$_$
    LANGUAGE plpgsql;


--
-- Name: t_update_mp_stats(); Type: FUNCTION; Schema: public; Owner: postgres
--

239
CREATE OR REPLACE FUNCTION t_update_mp_stats() RETURNS "trigger"
Octopus in vitro's avatar
Octopus in vitro committed
240 241 242 243
    AS $$
begin

  IF tg_op = 'DELETE' THEN
244 245 246 247
    PERFORM calc_gpa_mp(OLD.student_id::int, OLD.marking_period_id::varchar);
    PERFORM calc_cum_gpa(OLD.marking_period_id::varchar, OLD.student_id::int);
    PERFORM calc_cum_cr_gpa(OLD.marking_period_id::varchar, OLD.student_id::int);

Octopus in vitro's avatar
Octopus in vitro committed
248
  ELSE
249 250 251 252 253 254
    --IF tg_op = 'INSERT' THEN
        --we need to do stuff here to gather other information since it's a new record.
    --ELSE
        --if report_card_grade_id changes, then we need to reset gp values
    --  IF NOT NEW.report_card_grade_id = OLD.report_card_grade_id THEN
            --
255 256 257
    PERFORM calc_gpa_mp(NEW.student_id::int, NEW.marking_period_id::varchar);
    PERFORM calc_cum_gpa(NEW.marking_period_id::varchar, NEW.student_id::int);
    PERFORM calc_cum_cr_gpa(NEW.marking_period_id::varchar, NEW.student_id::int);
Octopus in vitro's avatar
Octopus in vitro committed
258 259 260 261 262 263 264 265 266 267 268
  END IF;
  return NULL;
end
$$
    LANGUAGE plpgsql;


SET default_tablespace = '';

SET default_with_oids = false;

269 270 271 272 273
--
-- Name: access_log; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--

CREATE TABLE access_log (
274
    syear numeric(4,0) NOT NULL,
275 276 277 278
    username character varying(100),
    profile character varying(30),
    login_time timestamp(0) without time zone,
    ip_address character varying(50),
279
    user_agent text,
280 281 282 283 284 285
    status character varying(50)
);




286
--
287
-- Name: accounting_incomes; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
--

CREATE TABLE accounting_incomes (
    assigned_date date,
    comments character varying(255),
    id numeric,
    title character varying(255),
    amount numeric,
    school_id numeric,
    syear numeric
);




--
-- Name: accounting_incomes_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE accounting_incomes_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: accounting_incomes_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('accounting_incomes_seq', 1, false);




--
327
-- Name: accounting_salaries; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
--

CREATE TABLE accounting_salaries (
    staff_id numeric NOT NULL,
    assigned_date date,
    due_date date,
    comments character varying(255),
    id numeric,
    title character varying(255),
    amount numeric,
    school_id numeric,
    syear numeric
);




--
-- Name: accounting_salaries_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE accounting_salaries_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: accounting_salaries_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('accounting_salaries_seq', 1, false);




--
369
-- Name: accounting_payments; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
--

CREATE TABLE accounting_payments (
    id numeric NOT NULL,
    syear numeric NOT NULL,
    school_id numeric NOT NULL,
    staff_id numeric,
    amount numeric NOT NULL,
    payment_date date,
    comments character varying(255)
);




--
-- Name: accounting_payments_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE accounting_payments_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: accounting_payments_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('accounting_payments_seq', 1, false);




Octopus in vitro's avatar
Octopus in vitro committed
408
--
409
-- Name: address; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
--

CREATE TABLE address (
    address_id numeric(10,0) NOT NULL,
    house_no numeric(5,0),
    direction character varying(2),
    street character varying(30),
    apt character varying(5),
    zipcode character varying(10),
    city character varying(60),
    state character varying(10),
    mail_street character varying(30),
    mail_city character varying(60),
    mail_state character varying(10),
    mail_zipcode character varying(10),
    address character varying(255),
    mail_address character varying(255),
    phone character varying(30)
);




--
434
-- Name: address_field_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
--

CREATE TABLE address_field_categories (
    id numeric NOT NULL,
    title character varying(1000) NOT NULL,
    sort_order numeric,
    residence character(1),
    mailing character(1),
    bus character(1)
);




--
-- Name: address_field_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE address_field_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: address_field_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('address_field_categories_seq', 1, false);


--
471
-- Name: address_fields; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
--

CREATE TABLE address_fields (
    id numeric NOT NULL,
    type character varying(10) NOT NULL,
    title character varying(1000) NOT NULL,
    sort_order numeric,
    select_options character varying(10000),
    category_id numeric,
    required character varying(1),
    default_selection character varying(255)
);




--
-- Name: address_fields_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE address_fields_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: address_fields_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('address_fields_seq', 1, true);


--
-- Name: address_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE address_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: address_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('address_seq', 1, true);


--
531
-- Name: attendance_calendar; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
--

CREATE TABLE attendance_calendar (
    syear numeric(4,0) NOT NULL,
    school_id numeric NOT NULL,
    school_date date NOT NULL,
    minutes numeric,
    block character varying(10),
    calendar_id numeric NOT NULL
);




--
547
-- Name: attendance_calendars; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
--

CREATE TABLE attendance_calendars (
    school_id numeric,
    title character varying(100),
    syear numeric(4,0),
    calendar_id numeric NOT NULL,
    default_calendar character varying(1),
    rollover_id numeric
);




--
563
-- Name: attendance_code_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
--

CREATE TABLE attendance_code_categories (
    id numeric,
    syear numeric(4,0),
    school_id numeric,
    title character varying(255),
    sort_order numeric,
    rollover_id numeric
);




--
-- Name: attendance_code_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE attendance_code_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: attendance_code_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('attendance_code_categories_seq', 1, false);


--
600
-- Name: attendance_codes; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
--

CREATE TABLE attendance_codes (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    title character varying(100),
    short_name character varying(10),
    type character varying(10),
    state_code character varying(1),
    default_code character varying(1),
    table_name numeric,
    sort_order numeric
);




--
-- Name: attendance_codes_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE attendance_codes_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: attendance_codes_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('attendance_codes_seq', 4, true);


--
641
-- Name: attendance_completed; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
642 643 644 645 646 647 648 649 650 651 652 653 654
--

CREATE TABLE attendance_completed (
    staff_id numeric NOT NULL,
    school_date date NOT NULL,
    period_id numeric NOT NULL,
    table_name numeric NOT NULL
);




--
655
-- Name: attendance_day; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671
--

CREATE TABLE attendance_day (
    student_id numeric NOT NULL,
    school_date date NOT NULL,
    minutes_present numeric,
    state_value numeric(2,1),
    syear numeric(4,0),
    marking_period_id numeric,
    comment character varying(255)
);




--
672
-- Name: attendance_period; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
--

CREATE TABLE attendance_period (
    student_id numeric NOT NULL,
    school_date date NOT NULL,
    period_id numeric NOT NULL,
    attendance_code numeric,
    attendance_teacher_code numeric,
    attendance_reason character varying(100),
    admin character varying(1),
    course_period_id numeric,
    marking_period_id numeric,
    comment character varying(100)
);




--
692
-- Name: billing_fees; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
--

CREATE TABLE billing_fees (
    student_id numeric NOT NULL,
    assigned_date date,
    due_date date,
    comments character varying(255),
    id numeric,
    title character varying(255),
    amount numeric,
    school_id numeric,
    syear numeric,
    waived_fee_id numeric,
    old_id numeric
);




--
-- Name: billing_fees_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE billing_fees_seq
717
    START WITH 1
Octopus in vitro's avatar
Octopus in vitro committed
718 719 720 721 722 723 724 725 726 727 728 729
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: billing_fees_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

730
SELECT pg_catalog.setval('billing_fees_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
731 732 733


--
734
-- Name: billing_payments; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756
--

CREATE TABLE billing_payments (
    id numeric NOT NULL,
    syear numeric NOT NULL,
    school_id numeric NOT NULL,
    student_id numeric NOT NULL,
    amount numeric NOT NULL,
    payment_date date,
    comments character varying(255),
    refunded_payment_id numeric,
    lunch_payment character varying(1)
);




--
-- Name: billing_payments_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE billing_payments_seq
757
    START WITH 1
Octopus in vitro's avatar
Octopus in vitro committed
758 759 760 761 762 763 764 765 766 767 768 769
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: billing_payments_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

770
SELECT pg_catalog.setval('billing_payments_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
771 772 773


--
774
-- Name: calendar_events; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831
--

CREATE TABLE calendar_events (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    school_date date,
    title character varying(50),
    description character varying(500)
);




--
-- Name: calendar_events_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE calendar_events_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: calendar_events_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('calendar_events_seq', 1, true);


--
-- Name: calendars_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE calendars_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: calendars_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('calendars_seq', 1, true);


--
832
-- Name: config; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
833 834 835
--

CREATE TABLE config (
836
    school_id numeric NOT NULL,
Octopus in vitro's avatar
Octopus in vitro committed
837
    title character varying(100),
838
    config_value text
Octopus in vitro's avatar
Octopus in vitro committed
839 840 841 842 843 844
);




--
845
-- Name: course_periods; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879
--

CREATE TABLE course_periods (
    syear numeric(4,0) NOT NULL,
    school_id numeric NOT NULL,
    course_period_id numeric NOT NULL,
    course_id numeric NOT NULL,
    title character varying(255),
    short_name character varying(25) NOT NULL,
    mp character varying(3),
    marking_period_id numeric,
    teacher_id numeric NOT NULL,
    room character varying(10),
    total_seats numeric,
    filled_seats numeric,
    does_attendance character varying(255),
    does_honor_roll character varying(1),
    does_class_rank character varying(1),
    gender_restriction character varying(1),
    house_restriction character varying(1),
    availability numeric,
    parent_id numeric,
    calendar_id numeric,
    half_day character varying(1),
    does_breakoff character varying(1),
    rollover_id numeric,
    grade_scale_id numeric,
    credits numeric
);




--
880
-- Name: courses; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
881 882 883 884 885 886 887 888 889 890 891
--

CREATE TABLE courses (
    syear numeric(4,0) NOT NULL,
    course_id numeric NOT NULL,
    subject_id numeric NOT NULL,
    school_id numeric NOT NULL,
    grade_level numeric,
    title character varying(100) NOT NULL,
    short_name character varying(25),
    rollover_id numeric,
892 893
    credit_hours numeric(6,2),
    description text
Octopus in vitro's avatar
Octopus in vitro committed
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
);




--
-- Name: course_details; Type: VIEW; Schema: public; Owner: rosariosis
--

CREATE VIEW course_details AS
    SELECT cp.school_id, cp.syear, cp.marking_period_id, c.subject_id, cp.course_id, cp.course_period_id, cp.teacher_id, c.title AS course_title, cp.title AS cp_title, cp.grade_scale_id, cp.mp, cp.credits FROM course_periods cp, courses c WHERE (cp.course_id = c.course_id);




--
910
-- Name: course_period_school_periods; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965
--

CREATE TABLE course_period_school_periods (
    course_period_school_periods_id numeric NOT NULL,
    course_period_id numeric NOT NULL,
    period_id numeric NOT NULL,
    days character varying(7)
);




--
-- Name: course_period_school_periods_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE course_period_school_periods_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: course_period_school_periods_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('course_period_school_periods_seq', 1, true);


--
-- Name: course_periods_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE course_periods_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: course_periods_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('course_periods_seq', 1, true);


--
966
-- Name: course_subjects; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
--

CREATE TABLE course_subjects (
    syear numeric(4,0),
    school_id numeric,
    subject_id numeric NOT NULL,
    title character varying(100) NOT NULL,
    short_name character varying(25),
    sort_order numeric,
    rollover_id numeric
);




--
-- Name: course_subjects_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE course_subjects_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: course_subjects_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('course_subjects_seq', 1, true);


--
-- Name: courses_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE courses_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: courses_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('courses_seq', 1, true);




--
1027
-- Name: custom_fields; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
--

CREATE TABLE custom_fields (
    id numeric NOT NULL,
    type character varying(10) NOT NULL,
    title character varying(1000) NOT NULL,
    sort_order numeric,
    select_options character varying(10000),
    category_id numeric,
    required character varying(1),
    default_selection character varying(255)
);




--
-- Name: custom_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE custom_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: custom_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('custom_seq', 1, true);


--
1066
-- Name: discipline_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
--

CREATE TABLE discipline_categories (
    id numeric,
    syear numeric(4,0),
    school_id numeric,
    title character varying(255),
    sort_order numeric,
    type character varying(30),
    options character varying(10000)
);




--
-- Name: discipline_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE discipline_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: discipline_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('discipline_categories_seq', 1, false);


--
1104
-- Name: discipline_field_usage; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
--

CREATE TABLE discipline_field_usage (
    id numeric NOT NULL,
    discipline_field_id numeric NOT NULL,
    syear numeric NOT NULL,
    school_id numeric NOT NULL,
    title character varying(255),
    select_options character varying(10000),
    sort_order numeric
);




--
-- Name: discipline_field_usage_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE discipline_field_usage_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: discipline_field_usage_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

1138
SELECT pg_catalog.setval('discipline_field_usage_seq', 6, true);
Octopus in vitro's avatar
Octopus in vitro committed
1139 1140 1141


--
1142
-- Name: discipline_fields; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160
--

CREATE TABLE discipline_fields (
    id numeric NOT NULL,
    title character varying(255) NOT NULL,
    short_name character varying(20),
    data_type character varying(30) NOT NULL,
    column_name character varying(255) NOT NULL
);




--
-- Name: discipline_fields_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE discipline_fields_seq
1161
    START WITH 6
Octopus in vitro's avatar
Octopus in vitro committed
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: discipline_fields_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

1174
SELECT pg_catalog.setval('discipline_fields_seq', 6, true);
Octopus in vitro's avatar
Octopus in vitro committed
1175 1176 1177


--
1178
-- Name: discipline_referrals; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
--

CREATE TABLE discipline_referrals (
    id numeric NOT NULL,
    syear numeric NOT NULL,
    student_id numeric NOT NULL,
    school_id numeric NOT NULL,
    staff_id numeric,
    entry_date date,
    referral_date date,
    category_1 character varying(1000),
    category_2 character varying(1000),
    category_3 character varying(1),
    category_4 character varying(1000),
    category_5 character varying(1000),
    category_6 character varying(5000)
);




--
-- Name: discipline_referrals_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE discipline_referrals_seq
1205
    START WITH 1
Octopus in vitro's avatar
Octopus in vitro committed
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: discipline_referrals_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

1218
SELECT pg_catalog.setval('discipline_referrals_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
1219 1220 1221


--
1222
-- Name: eligibility; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237
--

CREATE TABLE eligibility (
    student_id numeric,
    syear numeric(4,0),
    school_date date,
    period_id numeric,
    eligibility_code character varying(20),
    course_period_id numeric
);




--
1238
-- Name: eligibility_activities; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1239 1240 1241 1242 1243 1244 1245 1246
--

CREATE TABLE eligibility_activities (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    title character varying(100),
    start_date date,
1247 1248
    end_date date,
    comment text
Octopus in vitro's avatar
Octopus in vitro committed
1249 1250 1251 1252 1253 1254 1255 1256 1257 1258
);




--
-- Name: eligibility_activities_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE eligibility_activities_seq
1259
    START WITH 3
Octopus in vitro's avatar
Octopus in vitro committed
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: eligibility_activities_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

1272
SELECT pg_catalog.setval('eligibility_activities_seq', 3, true);
Octopus in vitro's avatar
Octopus in vitro committed
1273 1274 1275


--
1276
-- Name: eligibility_completed; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288
--

CREATE TABLE eligibility_completed (
    staff_id numeric NOT NULL,
    school_date date NOT NULL,
    period_id numeric NOT NULL
);




--
1289
-- Name: school_gradelevels; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
--

CREATE TABLE school_gradelevels (
    id numeric NOT NULL,
    school_id numeric NOT NULL,
    short_name character varying(2),
    title character varying(50),
    next_grade_id numeric,
    sort_order numeric
);




1304
--
1305
-- Name: student_assignments; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316
--

CREATE TABLE student_assignments (
    assignment_id numeric NOT NULL,
    student_id numeric NOT NULL,
    data text
);




Octopus in vitro's avatar
Octopus in vitro committed
1317
--
1318
-- Name: student_enrollment; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
--

CREATE TABLE student_enrollment (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    student_id numeric,
    grade_id numeric,
    start_date date,
    end_date date,
    enrollment_code numeric,
    drop_code numeric,
    next_school numeric,
    calendar_id numeric,
    last_school numeric
);




--
-- Name: enroll_grade; Type: VIEW; Schema: public; Owner: rosariosis
--

CREATE VIEW enroll_grade AS
    SELECT e.id, e.syear, e.school_id, e.student_id, e.start_date, e.end_date, sg.short_name, sg.title FROM student_enrollment e, school_gradelevels sg WHERE (e.grade_id = sg.id);




--
-- Name: VIEW enroll_grade; Type: COMMENT; Schema: public; Owner: rosariosis
--

COMMENT ON VIEW enroll_grade IS 'Provides enrollment dates and grade levels';


--
1357
-- Name: food_service_accounts; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369
--

CREATE TABLE food_service_accounts (
    account_id numeric NOT NULL,
    balance numeric(9,2) NOT NULL,
    transaction_id numeric
);




--
1370
-- Name: food_service_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405
--

CREATE TABLE food_service_categories (
    category_id numeric NOT NULL,
    school_id numeric NOT NULL,
    menu_id numeric NOT NULL,
    title character varying(25),
    sort_order numeric
);




--
-- Name: food_service_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_categories_seq', 1, true);


--
1406
-- Name: food_service_items; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446
--

CREATE TABLE food_service_items (
    item_id numeric NOT NULL,
    school_id numeric NOT NULL,
    short_name character varying(25),
    sort_order numeric,
    description character varying(25),
    icon character varying(50),
    price numeric(9,2) NOT NULL,
    price_reduced numeric(9,2),
    price_free numeric(9,2),
    price_staff numeric(9,2) NOT NULL
);




--
-- Name: food_service_items_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_items_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_items_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_items_seq', 4, true);


--
1447
-- Name: food_service_menu_items; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484
--

CREATE TABLE food_service_menu_items (
    menu_item_id numeric NOT NULL,
    school_id numeric NOT NULL,
    menu_id numeric NOT NULL,
    item_id numeric NOT NULL,
    category_id numeric,
    sort_order numeric,
    does_count character varying(1)
);




--
-- Name: food_service_menu_items_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_menu_items_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_menu_items_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_menu_items_seq', 4, true);


--
1485
-- Name: food_service_menus; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
--

CREATE TABLE food_service_menus (
    menu_id numeric NOT NULL,
    school_id numeric NOT NULL,
    title character varying(25) NOT NULL,
    sort_order numeric
);




--
-- Name: food_service_menus_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_menus_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_menus_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_menus_seq', 1, true);


--
1520
-- Name: food_service_staff_accounts; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534
--

CREATE TABLE food_service_staff_accounts (
    staff_id numeric NOT NULL,
    status character varying(25),
    barcode character varying(50),
    balance numeric(9,2) NOT NULL,
    transaction_id numeric
);




--
1535
-- Name: food_service_staff_transaction_items; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549
--

CREATE TABLE food_service_staff_transaction_items (
    item_id numeric NOT NULL,
    transaction_id numeric NOT NULL,
    amount numeric(9,2),
    short_name character varying(25),
    description character varying(50)
);




--
1550
-- Name: food_service_staff_transactions; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589
--

CREATE TABLE food_service_staff_transactions (
    transaction_id numeric NOT NULL,
    staff_id numeric NOT NULL,
    school_id numeric,
    syear numeric(4,0),
    balance numeric(9,2),
    "timestamp" timestamp(0) without time zone,
    short_name character varying(25),
    description character varying(50),
    seller_id numeric
);




--
-- Name: food_service_staff_transactions_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_staff_transactions_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_staff_transactions_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_staff_transactions_seq', 1, true);


--
1590
-- Name: food_service_student_accounts; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604
--

CREATE TABLE food_service_student_accounts (
    student_id numeric NOT NULL,
    account_id numeric NOT NULL,
    discount character varying(25),
    status character varying(25),
    barcode character varying(50)
);




--
1605
-- Name: food_service_transaction_items; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620
--

CREATE TABLE food_service_transaction_items (
    item_id numeric NOT NULL,
    transaction_id numeric NOT NULL,
    amount numeric(9,2),
    discount character varying(25),
    short_name character varying(25),
    description character varying(50)
);




--
1621
-- Name: food_service_transactions; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662
--

CREATE TABLE food_service_transactions (
    transaction_id numeric NOT NULL,
    account_id numeric NOT NULL,
    student_id numeric,
    school_id numeric,
    syear numeric(4,0),
    discount character varying(25),
    balance numeric(9,2),
    "timestamp" timestamp(0) without time zone,
    short_name character varying(25),
    description character varying(50),
    seller_id numeric
);




--
-- Name: food_service_transactions_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE food_service_transactions_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: food_service_transactions_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('food_service_transactions_seq', 1, true);


--
1663
-- Name: gradebook_assignment_types; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1664 1665 1666 1667 1668 1669 1670 1671 1672
--

CREATE TABLE gradebook_assignment_types (
    assignment_type_id numeric NOT NULL,
    staff_id numeric,
    course_id numeric,
    title character varying(100) NOT NULL,
    final_grade_percent numeric(6,5),
    sort_order numeric,
1673
    color character varying(30),
1674
    created_mp integer
Octopus in vitro's avatar
Octopus in vitro committed
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701
);




--
-- Name: gradebook_assignment_types_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE gradebook_assignment_types_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: gradebook_assignment_types_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('gradebook_assignment_types_seq', 1, false);


--
1702
-- Name: gradebook_assignments; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715
--

CREATE TABLE gradebook_assignments (
    assignment_id numeric NOT NULL,
    staff_id numeric,
    marking_period_id numeric,
    course_period_id numeric,
    course_id numeric,
    assignment_type_id numeric NOT NULL,
    title character varying(100) NOT NULL,
    assigned_date date,
    due_date date,
    points numeric NOT NULL,
1716
    description text,
1717
    file character varying(1000),
1718 1719
    default_points numeric,
    submission character varying(1)
Octopus in vitro's avatar
Octopus in vitro committed
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746
);




--
-- Name: gradebook_assignments_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE gradebook_assignments_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: gradebook_assignments_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('gradebook_assignments_seq', 1, true);


--
1747
-- Name: gradebook_grades; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762
--

CREATE TABLE gradebook_grades (
    student_id numeric NOT NULL,
    period_id numeric,
    course_period_id numeric NOT NULL,
    assignment_id numeric NOT NULL,
    points numeric(6,2),
    comment character varying(100)
);




--
1763
-- Name: grades_completed; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775
--

CREATE TABLE grades_completed (
    staff_id numeric NOT NULL,
    marking_period_id character varying(10) NOT NULL,
    course_period_id numeric NOT NULL
);




--
1776
-- Name: history_marking_periods; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793
--

CREATE TABLE history_marking_periods (
    parent_id integer,
    mp_type character(20),
    name character(30),
    short_name character varying(10),
    post_end_date date,
    school_id integer,
    syear integer,
    marking_period_id integer NOT NULL
);




--
1794
-- Name: lunch_period; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835
--

CREATE TABLE lunch_period (
    student_id numeric NOT NULL,
    school_date date NOT NULL,
    period_id numeric NOT NULL,
    attendance_code numeric,
    attendance_teacher_code numeric,
    attendance_reason character varying(100),
    admin character varying(1),
    course_period_id numeric,
    marking_period_id numeric,
    comment character varying(100),
    table_name numeric
);




--
-- Name: marking_period_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE marking_period_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: marking_period_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('marking_period_seq', 11, true);


--
1836
-- Name: school_marking_periods; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864
--

CREATE TABLE school_marking_periods (
    marking_period_id numeric NOT NULL,
    syear numeric(4,0),
    mp character varying(3) NOT NULL,
    school_id numeric,
    parent_id numeric,
    title character varying(50),
    short_name character varying(10),
    sort_order numeric,
    start_date date NOT NULL,
    end_date date NOT NULL,
    post_start_date date,
    post_end_date date,
    does_grades character varying(1),
    does_comments character varying(1),
    rollover_id numeric
);




--
-- Name: marking_periods; Type: VIEW; Schema: public; Owner: rosariosis
--

CREATE VIEW marking_periods AS
Octopus in vitro's avatar
Octopus in vitro committed
1865
    SELECT school_marking_periods.marking_period_id, 'Rosario'::text AS mp_source, school_marking_periods.syear, school_marking_periods.school_id, CASE WHEN ((school_marking_periods.mp)::text = 'FY'::text) THEN 'year'::text WHEN ((school_marking_periods.mp)::text = 'SEM'::text) THEN 'semester'::text WHEN ((school_marking_periods.mp)::text = 'QTR'::text) THEN 'quarter'::text ELSE NULL::text END AS mp_type, school_marking_periods.title, school_marking_periods.short_name, school_marking_periods.sort_order, CASE WHEN (school_marking_periods.parent_id > (0)::numeric) THEN school_marking_periods.parent_id ELSE ((-1))::numeric END AS parent_id, CASE WHEN ((SELECT smp.parent_id FROM school_marking_periods smp WHERE (smp.marking_period_id = school_marking_periods.parent_id)) > (0)::numeric) THEN (SELECT smp.parent_id FROM school_marking_periods smp WHERE (smp.marking_period_id = school_marking_periods.parent_id)) ELSE ((-1))::numeric END AS grandparent_id, school_marking_periods.start_date, school_marking_periods.end_date, school_marking_periods.post_start_date, school_marking_periods.post_end_date, school_marking_periods.does_grades, school_marking_periods.does_comments FROM school_marking_periods UNION SELECT history_marking_periods.marking_period_id, 'History'::text AS mp_source, history_marking_periods.syear, history_marking_periods.school_id, history_marking_periods.mp_type, history_marking_periods.name AS title, history_marking_periods.short_name, NULL::numeric AS sort_order, history_marking_periods.parent_id, (-1) AS grandparent_id, NULL::date AS start_date, history_marking_periods.post_end_date AS end_date, NULL::date AS post_start_date, history_marking_periods.post_end_date, 'Y'::character varying AS does_grades, NULL::character varying AS does_comments FROM history_marking_periods;
Octopus in vitro's avatar
Octopus in vitro committed
1866 1867 1868 1869 1870




--
1871
-- Name: moodlexrosario; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883
--

CREATE TABLE moodlexrosario (
    "column" character varying(100) NOT NULL,
    rosario_id numeric NOT NULL,
    moodle_id numeric NOT NULL
);




--
1884
-- Name: people; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
--

CREATE TABLE people (
    person_id numeric(10,0) NOT NULL,
    last_name character varying(50) NOT NULL,
    first_name character varying(50) NOT NULL,
    middle_name character varying(50)
);




--
1898
-- Name: people_field_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933
--

CREATE TABLE people_field_categories (
    id numeric NOT NULL,
    title character varying(1000),
    sort_order numeric,
    custody character(1),
    emergency character(1)
);




--
-- Name: people_field_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE people_field_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: people_field_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('people_field_categories_seq', 1, false);


--
1934
-- Name: people_fields; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972
--

CREATE TABLE people_fields (
    id numeric NOT NULL,
    type character varying(10),
    title character varying(1000),
    sort_order numeric,
    select_options character varying(10000),
    category_id numeric,
    required character varying(1),
    default_selection character varying(255)
);




--
-- Name: people_fields_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE people_fields_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: people_fields_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('people_fields_seq', 1, true);


--
1973
-- Name: people_join_contacts; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028
--

CREATE TABLE people_join_contacts (
    id numeric NOT NULL,
    person_id numeric,
    title character varying(100),
    value character varying(100)
);




--
-- Name: people_join_contacts_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE people_join_contacts_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: people_join_contacts_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('people_join_contacts_seq', 1, true);


--
-- Name: people_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE people_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: people_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('people_seq', 1, true);


--
2029
-- Name: portal_notes; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067
--

CREATE TABLE portal_notes (
    id numeric NOT NULL,
    school_id numeric,
    syear numeric(4,0),
    title character varying(255),
    content character varying(5000),
    sort_order numeric,
    published_user numeric,
    published_date timestamp(0) without time zone,
    start_date date,
    end_date date,
    published_profiles character varying(255),
    file_attached character varying(270)
);




--
-- Name: portal_notes_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE portal_notes_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: portal_notes_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

2068
SELECT pg_catalog.setval('portal_notes_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
2069 2070 2071


--
2072
-- Name: portal_poll_questions; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104
--

CREATE TABLE portal_poll_questions (
    id numeric NOT NULL,
    portal_poll_id numeric NOT NULL,
    question character varying(255),
    type character varying(20),
    options character varying(5000),
    votes character varying(255)
);




--
-- Name: portal_poll_questions_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE portal_poll_questions_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: portal_poll_questions_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

2105
SELECT pg_catalog.setval('portal_poll_questions_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
2106 2107 2108


--
2109
-- Name: portal_polls; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124
--

CREATE TABLE portal_polls (
    id numeric NOT NULL,
    school_id numeric,
    syear numeric(4,0),
    title character varying(255),
    votes_number numeric,
    display_votes character varying(1),
    sort_order numeric,
    published_user numeric,
    published_date timestamp(0) without time zone,
    start_date date,
    end_date date,
    published_profiles character varying(255),
2125
    students_teacher_id numeric,
Octopus in vitro's avatar
Octopus in vitro committed
2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149
    excluded_users text
);




--
-- Name: portal_polls_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE portal_polls_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: portal_polls_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

2150
SELECT pg_catalog.setval('portal_polls_seq', 1, false);
Octopus in vitro's avatar
Octopus in vitro committed
2151 2152 2153


--
2154
-- Name: profile_exceptions; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167
--

CREATE TABLE profile_exceptions (
    profile_id numeric,
    modname character varying(255),
    can_use character varying(1),
    can_edit character varying(1)
);




--
2168
-- Name: program_config; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2169 2170 2171 2172 2173 2174 2175
--

CREATE TABLE program_config (
    syear numeric(4,0),
    school_id numeric,
    program character varying(255),
    title character varying(100),
2176
    value character varying(2550)
Octopus in vitro's avatar
Octopus in vitro committed
2177 2178 2179 2180 2181 2182
);




--
2183
-- Name: program_user_config; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197
--

CREATE TABLE program_user_config (
    user_id numeric NOT NULL,
    program character varying(255),
    title character varying(100),
    value character varying(100),
    school_id numeric
);




--
2198
-- Name: report_card_comment_categories; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236
--

CREATE TABLE report_card_comment_categories (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    course_id numeric,
    sort_order numeric,
    title character varying(1000),
    rollover_id numeric,
    color character varying(30)
);




--
-- Name: report_card_comment_categories_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_comment_categories_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_comment_categories_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('report_card_comment_categories_seq', 1, true);


--
2237
-- Name: report_card_comment_code_scales; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273
--

CREATE TABLE report_card_comment_code_scales (
    id numeric NOT NULL,
    school_id numeric NOT NULL,
    title character varying(25),
    comment character varying(100),
    sort_order numeric,
    rollover_id numeric
);




--
-- Name: report_card_comment_code_scales_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_comment_code_scales_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_comment_code_scales_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('report_card_comment_code_scales_seq', 1, false);


--
2274
-- Name: report_card_comment_codes; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311
--

CREATE TABLE report_card_comment_codes (
    id numeric NOT NULL,
    school_id numeric NOT NULL,
    scale_id numeric NOT NULL,
    title character varying(5) NOT NULL,
    short_name character varying(100),
    comment character varying(100),
    sort_order numeric
);




--
-- Name: report_card_comment_codes_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_comment_codes_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_comment_codes_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('report_card_comment_codes_seq', 1, false);


--
2312
-- Name: report_card_comments; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333
--

CREATE TABLE report_card_comments (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    course_id numeric,
    category_id numeric,
    scale_id numeric,
    sort_order numeric,
    title character varying(5000)
);




--
-- Name: report_card_comments_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_comments_seq
2334
    START WITH 3
Octopus in vitro's avatar
Octopus in vitro committed
2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_comments_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

2347
SELECT pg_catalog.setval('report_card_comments_seq', 3, true);
Octopus in vitro's avatar
Octopus in vitro committed
2348 2349 2350


--
2351
-- Name: report_card_grade_scales; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2352 2353 2354 2355 2356 2357 2358 2359
--

CREATE TABLE report_card_grade_scales (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric NOT NULL,
    title character varying(300),
    comment character varying(1000),
2360 2361
    hhr_gpa_value numeric,
    hr_gpa_value numeric,
Octopus in vitro's avatar
Octopus in vitro committed
2362 2363 2364
    sort_order numeric,
    rollover_id numeric,
    gp_scale numeric(10,3),
2365
    gp_passing_value numeric(10,3),
2366
    hrs_gpa_value numeric
Octopus in vitro's avatar
Octopus in vitro committed
2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389
);




--
-- Name: report_card_grade_scales_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_grade_scales_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_grade_scales_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

2390
SELECT pg_catalog.setval('report_card_grade_scales_seq', 1, true);
Octopus in vitro's avatar
Octopus in vitro committed
2391 2392 2393


--
2394
-- Name: report_card_grades; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2395 2396 2397 2398 2399 2400 2401 2402
--

CREATE TABLE report_card_grades (
    id numeric NOT NULL,
    syear numeric(4,0),
    school_id numeric,
    title character varying(100),
    sort_order numeric,
2403
    gpa_value numeric,
Octopus in vitro's avatar
Octopus in vitro committed
2404 2405 2406
    break_off numeric,
    comment character varying(1000),
    grade_scale_id numeric,
2407
    unweighted_gp numeric
Octopus in vitro's avatar
Octopus in vitro committed
2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433
);




--
-- Name: report_card_grades_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--

CREATE SEQUENCE report_card_grades_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;




--
-- Name: report_card_grades_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--

SELECT pg_catalog.setval('report_card_grades_seq', 15, true);


2434 2435 2436
--
-- Name: resources; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
--
2437

2438
CREATE TABLE resources (
2439 2440 2441 2442
    id numeric NOT NULL,
    school_id numeric NOT NULL,
    title character varying(256),
    link character varying(1000)
2443
);
2444 2445


2446 2447 2448
--
-- Name: resources_seq; Type: SEQUENCE; Schema: public; Owner: rosariosis
--
2449

2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460
CREATE SEQUENCE resources_seq
START WITH 3
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: resources_seq; Type: SEQUENCE SET; Schema: public; Owner: rosariosis
--
2461

2462 2463 2464
SELECT pg_catalog.setval('resources_seq', 3, true);


Octopus in vitro's avatar
Octopus in vitro committed
2465
--
2466
-- Name: schedule; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488
--

CREATE TABLE schedule (
    syear numeric(4,0) NOT NULL,
    school_id numeric,
    student_id numeric NOT NULL,
    start_date date NOT NULL,
    end_date date,
    modified_date date,
    modified_by character varying(255),
    course_id numeric NOT NULL,
    course_period_id numeric NOT NULL,
    mp character varying(3),
    marking_period_id numeric,
    scheduler_lock character varying(1),
    id numeric
);




--
2489
-- Name: schedule_requests; Type: TABLE; Schema: public; Owner: rosariosis; Tablespace:
Octopus in vitro's avatar
Octopus in vitro committed
2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502