Esempio n. 1
0
)
attached_files = rdb.Table("attached_files", metadata,
    rdb.Column("attached_file_id", rdb.Integer, primary_key=True),
    # the id of the "owning" item !+HEAD_DOCUMENT_ITEM
    rdb.Column("item_id", rdb.Integer,
        rdb.ForeignKey("parliamentary_items.parliamentary_item_id"),
        nullable=False
    ),
    rdb.Column("attached_file_type_id", rdb.Integer,
        rdb.ForeignKey("attached_file_types.attached_file_type_id"),
        nullable=False
    ),
    rdb.Column("file_version_id", rdb.Integer), # !+ATTACHED_FILE_VERSIONS
    rdb.Column("file_title", rdb.Unicode(255), nullable=False),
    rdb.Column("file_description", rdb.UnicodeText),
    rdb.Column("file_data", FSBlob(32)),
    rdb.Column("file_name", rdb.String(200)),
    rdb.Column("file_mimetype", rdb.String(127)),
    # Workflow State
    rdb.Column("status", rdb.Unicode(48)),
    rdb.Column("status_date", rdb.DateTime(timezone=False),
        server_default=(text("now()")),
        nullable=False
    ),
    rdb.Column("language", rdb.String(5), nullable=False),
)
attached_files_index = rdb.Index("attfiles_itemid_idx", 
    attached_files.c["item_id"]
)

registrySequence = rdb.Sequence("registry_number_sequence", metadata = metadata)
Esempio n. 2
0
    sa.Column("time", sa.Time(timezone=False)),
    sa.Column("issue_item", sa.Unicode(1024)),
    sa.Column("issue_sub_item", sa.Unicode(1024)),
    sa.Column("document_uri", sa.Unicode(1024)),
    sa.Column("question", sa.Unicode(1024)),
    sa.Column("description", sa.UnicodeText),
    sa.Column("notes", sa.UnicodeText),
    sa.Column("result", sa.Unicode(255)),
    sa.Column("vote_type", sa.Unicode(255)),
    sa.Column("majority_type", sa.Unicode(255)),
    sa.Column("eligible_votes", sa.Integer),
    sa.Column("cast_votes", sa.Integer),
    sa.Column("votes_for", sa.Integer),
    sa.Column("votes_against", sa.Integer),
    sa.Column("votes_abstained", sa.Integer),
    sa.Column("roll_call", FSBlob(32)),
    sa.Column("mimetype", sa.Unicode(127)),
    sa.Column("language", sa.String(5), nullable=False, default="en"),
)

sitting_report = sa.Table(
    "sitting_report",
    metadata,
    sa.Column("report_id",
              sa.Integer,
              sa.ForeignKey("doc.doc_id"),
              primary_key=True),
    sa.Column("sitting_id",
              sa.Integer,
              sa.ForeignKey("sitting.sitting_id"),
              primary_key=True),
Esempio n. 3
0
    # the id of the "owning" head document
    # !+doc_attachment -- this assumes that attachments are only for doc?
    rdb.Column("head_id",
               rdb.Integer,
               rdb.ForeignKey("doc.doc_id"),
               nullable=False),
    # attachment_type #!+attached_file_type
    rdb.Column(
        "type",
        rdb.Unicode(128),
        default="document",
        nullable=False,
    ),
    rdb.Column("title", rdb.Unicode(255), nullable=False),  #!+file
    rdb.Column("description", rdb.UnicodeText),  #!+file
    rdb.Column("data", FSBlob(32)),  #!+file
    rdb.Column("name", rdb.String(200)),  #!+file
    rdb.Column("mimetype", rdb.String(127)),  #!+file
    # Workflow State
    rdb.Column("status", rdb.Unicode(48)),
    rdb.Column("status_date",
               rdb.DateTime(timezone=False),
               server_default=text("now()"),
               nullable=False),
    rdb.Column("language", rdb.String(5), nullable=False),
)
attachment_index = rdb.Index("attachment_head_id_idx", attachment.c["head_id"])

# attachment_audit
attachment_audit = make_audit_table(attachment, metadata)