"""art_relations Models.""" import datetime import decimal from typing import Any, Optional from sqlalchemy import ( CHAR, DECIMAL, JSON, BigInteger, CheckConstraint, Column, Double, Enum, Float, ForeignKeyConstraint, Index, Integer, SmallInteger, String, Table, Text, Time, text, ) from sqlalchemy.dialects.mysql import ( BIGINT, BIT, CHAR, DECIMAL, ENUM, FLOAT, INTEGER, LONGTEXT, MEDIUMINT, MEDIUMTEXT, SET, SMALLINT, TEXT, TINYINT, VARCHAR, ) from sqlalchemy.orm import ( DeclarativeBase, Mapped, MappedAsDataclass, mapped_column, relationship, ) from abacus_models.core.mixins import ( BaseMixin, CreateMixin, SoftDeleteMixin, UpdateMixin, ) from abacus_models.core.types import NormalizedDate, NormalizedDateTime class Base(MappedAsDataclass, DeclarativeBase, BaseMixin): pass class AcctPeriod(Base): __tablename__ = 'acct_period' __table_args__ = ( Index('year_month', 'year', 'month', unique=True), Index('year_quarter', 'year', 'quarter'), ) id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, autoincrement=True, init=False ) year: Mapped[str] = mapped_column( ENUM( '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', '2029', '2030', '2031', '2032', '2033', '2034', '2035', '2036', '2037', '2038', '2039', '2040', '2041', '2042', '2043', '2044', '2045', '2046', '2047', '2048', '2049', '2050', ), nullable=False, ) quarter: Mapped[str] = mapped_column(ENUM('1', '2', '3', '4'), nullable=False) month: Mapped[str] = mapped_column( ENUM('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'), nullable=False, ) class AdditionalArtistInfo(Base): __tablename__ = 'additional_artist_info' __table_args__ = ( Index('artist_id', 'artist_id'), Index('type', 'type'), {'comment': 'Additional Artists panel in edit artist page for entering si'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) type: Mapped[str] = mapped_column( ENUM('similar', 'influence', 'contemporary', 'follower'), nullable=False, server_default=text("'similar'"), comment="Type of artist. It can be one of the four types (similar artists, artist followers, artist influences and artist contemporaries). Enum values are 'similar','influence','contemporary','follower' and the default value is similar.", ) artist_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to artist_info table.', ) name: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Stores artist name.' ) artist_type: Mapped[Optional[str]] = mapped_column( ENUM('new', 'orchard'), server_default=text("'orchard'"), comment='Type of artist', default=None, ) class AdvanceRelease(Base): __tablename__ = 'advance_release' __table_args__ = {'comment': '(Deprecated) table is not used anymore'} advance_release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) release_name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Advance Release Name', default=None ) artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign Key referencing ex_a_artist_info or artist_info table', default=None, ) artist_type: Mapped[Optional[str]] = mapped_column( ENUM('new', 'orchard'), server_default=text("'orchard'"), comment='Type of Artist. New is from ex_a_artist_info table, orchard is from artist_info table', default=None, ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Release Date', default=None ) genre_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key referencing Genre table', default=None ) Description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Description', default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date Added', default=None ) class AdvanceReleaseLinks(Base): __tablename__ = 'advance_release_links' __table_args__ = {'comment': '(Deprecated) table is not used anymore'} id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) link_name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) advance_release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) class AdvanceTrack(Base): __tablename__ = 'advance_track' __table_args__ = ( Index( 'advance_release_id', 'advance_release_id', 'cd', 'track_id', unique=True ), {'comment': '(Deprecated) table is not used anymore'}, ) advance_track_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) track_name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) advance_release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) cd: Mapped[Optional[int]] = mapped_column(Integer, default=None) track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class AgreementAdvance(Base): __tablename__ = 'agreement_advance' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'Holds advance date and advance amount for agreements which a'}, ) agreement_advance_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to agreement table.', ) advance_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date the advance was given/applied.', default=None ) advance_amount: Mapped[Optional[float]] = mapped_column( Float, comment='The amount of the advance payment.', default=None ) class AgreementDms(Base): __tablename__ = 'agreement_dms' __table_args__ = { 'comment': 'Holds substores that are associated with particular agreemen' } agreement_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) type: Mapped[str] = mapped_column( ENUM('regular', 'restricted'), nullable=False, server_default=text("'restricted'"), comment='Type of DMS agreement.', ) class AgreementDmsMasterRestrictions(Base): __tablename__ = 'agreement_dms_master_restrictions' __table_args__ = { 'comment': 'Holds restricted master stores that are associated with part' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) dms_master_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to customer_master_master table.', ) class AgreementFormContentIn(Base): __tablename__ = 'agreement_form_content_in' __table_args__ = { 'comment': 'Holds information for agreements with type Content in Forms ' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) agreement_sub_type: Mapped[Optional[str]] = mapped_column( ENUM('artist', 'label'), comment="Sub type of agreement can be 'artist' or 'label'.", default=None, ) based_on: Mapped[Optional[str]] = mapped_column( ENUM('gross', 'net', 'other'), comment='The fees based on value.', default=None ) digital_split: Mapped[Optional[float]] = mapped_column( Float, comment='The split rate applied toward digital sales', default=None ) physical_split: Mapped[Optional[float]] = mapped_column( Float, comment='The split rate applied toward physical sales', default=None ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('yes_digital', 'yes_physical', 'yes_both', 'no_both'), comment='Whether the agreement enforces exclusivity', default=None, ) marketing_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether any marketing restrictions apply.', default=None, ) mfn: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not MFN applies.', default=None ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Orchard assignment right restriction flag.', default=None, ) minimum_payment_threshhold: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The threshhold that a label must pass before any payment is made. The comma separated values represent digital and physical threshhold value for artist, label, and release level payments.', default=None, ) encoding_fee_cap: Mapped[Optional[float]] = mapped_column( Float, comment="The encoding fee applied to each of Label's releases.", default=None, ) contract_version: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="The contract's version.", default=None, ) contract_term_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor_term', 'per_release_term'), comment='The type of contract term indicating whether same term applies to all releases or on each individual release.', default=None, ) dig_distribution_type: Mapped[Optional[str]] = mapped_column( ENUM('digital_mobile', 'digital_only', 'mobile_only'), comment='Indicates available distribution rights ', default=None, ) advance: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether an advance was made.', default=None ) advance_recouped_term: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates if the agreement has advanced recoup term.', default=None, ) advance_recoupable_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='The percentage of label earnings qualified toward advance recoupment', default=None, ) publishing_liability: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether orchard has publishing liability', default=None ) publishing_a_la_carte: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether publishing on a la carte is applicable', default=None, ) publishing_subscription: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='whether publishing on subcription is applicable', default=None, ) publishing_ringtone: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='whether publishing on ringtone sales is applicable', default=None, ) publishing_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding publishing.', default=None, ) execution_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='execution date for the agreement', default=None ) release_term_period: Mapped[Optional[int]] = mapped_column( Integer, comment='The period for individual releases for label with per release term', default=None, ) oms_deal_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'label', 'orchard'), server_default=text("'none'"), comment='The type of OMS deal.', default=None, ) oms_fee_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Applicable oms fees percentage', default=None ) oms_extra_fee: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Whether the extra fee applies.', default=None, ) oms_extra_fee_amount: Mapped[Optional[str]] = mapped_column( VARCHAR(60), comment='The percentage for the extra oms fees.', default=None ) class AgreementFormDmsp(Base): __tablename__ = 'agreement_form_dmsp' __table_args__ = { 'comment': 'Holds information for agreements with type DMSP forms' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) agreement_sub_type: Mapped[Optional[str]] = mapped_column( ENUM('dmsp'), server_default=text("'dmsp'"), comment="Sub type of agreement can be 'artist' or 'label'.", default=None, ) based_on: Mapped[Optional[str]] = mapped_column( ENUM('gross', 'net', 'other'), comment='The fees are based on value.', default=None, ) initial_delivery_charge: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether DMS is responsible for intial delivery of content.', default=None, ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether the agreement enforces exclusivity', default=None, ) mfn: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not MFN applies.', default=None ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not there are any assignment right restriction.', default=None, ) publishing_liability: Mapped[Optional[str]] = mapped_column( ENUM('us', 'ex_us', 'both'), comment='The region for publishing liability', default=None, ) publishing_us_a_la_carte: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'label', 'service'), comment='Indicates who is responsible for US a la carte publishing.', default=None, ) publishing_us_subscription: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'label', 'service'), comment='Indicates who is responsible for US subscription publishing.', default=None, ) publishing_exus_a_la_carte: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'label', 'service'), comment='Indicates who is responsible for ex-US a la carte publishing.', default=None, ) publishing_exus_subscription: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'label', 'service'), comment='Indicates who is responsible for ex-US subscription publishing.', default=None, ) publishing_notes: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), comment='Notes regarding publishing.', default=None, ) format: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='The format required for delivery of tracks', default=None, ) subsequent_delivery_period: Mapped[Optional[float]] = mapped_column( Float, comment='The period for each susequent deliveries', default=None ) target_due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date when the initial delivery is due', default=None ) encoder_id: Mapped[Optional[int]] = mapped_column( Integer, comment='The encoder for the content delivery.', default=None ) revenue_percentage_a_la_carte: Mapped[Optional[float]] = mapped_column( Float, comment='The percentage of revenue for a la carte', default=None ) revenue_percentage_subscription: Mapped[Optional[float]] = mapped_column( Float, comment='The percentage of revenue for subscription', default=None ) payment_term: Mapped[Optional[str]] = mapped_column( ENUM('within', 'after'), server_default=text("'within'"), comment='The payment term for revenue payments', default=None, ) payment_term_period: Mapped[Optional[str]] = mapped_column( ENUM('month', 'quarter'), comment='The period for each revenue payments.', default=None, ) payment_term_days: Mapped[Optional[int]] = mapped_column( Integer, comment='The # of days after the end of period that the payment is due.', default=None, ) target_signing_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Target Signing Date', default=None ) format_clip: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='The format required for a delivery of clips', default=None, ) revenue_info: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding the revenue terms', default=None, ) delivery_term: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding the delivery terms.', default=None, ) class AgreementFormMiscellaneous(Base): __tablename__ = 'agreement_form_miscellaneous' __table_args__ = { 'comment': 'Holds information for agreements with type miscellaneious fo' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) agreement_sub_type: Mapped[Optional[str]] = mapped_column( ENUM( 'concert_agreement', 'marketing', 'master_synch', 'orchard_publishing_synch', 'termination_letter', 'other', ), comment="Sub type of agreement can be 'artist' or 'label'.", default=None, ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates the exclusivity of this agreement.', default=None, ) mere_introduction_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Introduction Fee', default=None ) owed_revenue_orchard: Mapped[Optional[float]] = mapped_column( Float, comment='Owed revenue to Orchard', default=None ) owed_revenue_service: Mapped[Optional[float]] = mapped_column( Float, comment='Owed revenue to the service', default=None ) other: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Other information regarding the agreement', default=None, ) publishers_remittances: Mapped[Optional[float]] = mapped_column( Float, comment="Publishers' Remittances", default=None ) incomplete_exhibit_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Incomplete Exhibit Fee', default=None ) license_fee: Mapped[Optional[float]] = mapped_column( Float, comment='License Fee', default=None ) class AgreementFormMobile(Base): __tablename__ = 'agreement_form_mobile' __table_args__ = { 'comment': 'Holds information for agreements with type mobile forms' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) agreement_sub_type: Mapped[Optional[str]] = mapped_column( ENUM('mobile'), server_default=text("'mobile'"), comment="Sub type of agreement can be 'artist' or 'label'.", default=None, ) mobile_service_type: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The types of services provided', default=None, ) initial_delivery_charge: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether DMS is responsible for intial delivery of content.', default=None, ) subsequent_delivery_period: Mapped[Optional[float]] = mapped_column( Float, comment='Number of days for subsequent delivery.', default=None ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates the exclusivity of this agreement.', default=None, ) mfn: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not MFN applies.', default=None ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Whether or not there are restrictions on The Orchard's assignment rights", default=None, ) format: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='The format required for delivery of tracks', default=None, ) target_due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date when the initial delivery is due', default=None ) encoder_id: Mapped[Optional[int]] = mapped_column( Integer, comment='The encoder for the content delivery.', default=None ) publishing_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding publishing.', default=None, ) revenue_percentage_mastertone: Mapped[Optional[float]] = mapped_column( Float, comment='The rate for mastertone sales', default=None ) revenue_percentage_ringback: Mapped[Optional[float]] = mapped_column( Float, comment='The rate for ringback sales', default=None ) revenue_percentage_fulldownload: Mapped[Optional[float]] = mapped_column( Float, comment='The rate for full length downloads.', default=None ) revenue_annual_percentage_mastertone: Mapped[Optional[float]] = mapped_column( Float, comment='The rate for annual mastertone sales', default=None ) revenue_annual_percentage_ringback: Mapped[Optional[float]] = mapped_column( Float, comment='The rate for annual ringback sales', default=None ) payment_term: Mapped[Optional[str]] = mapped_column( ENUM('within', 'after'), server_default=text("'within'"), comment='The payment term for revenue payments', default=None, ) payment_term_period: Mapped[Optional[str]] = mapped_column( ENUM('month', 'quarter'), server_default=text("'month'"), comment='The period for each revenue payments.', default=None, ) payment_term_days: Mapped[Optional[int]] = mapped_column( Integer, comment='The # of days after the end of period that the payment is due.', default=None, ) format_clip: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='The format required for a delivery of clips', default=None, ) target_signing_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Target Signing Date', default=None ) revenue_info: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding the revenue terms', default=None, ) delivery_term: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes regarding the delivery terms.', default=None, ) class AgreementFormTerritorial(Base): __tablename__ = 'agreement_form_territorial' __table_args__ = { 'comment': 'Holds information for agreements with type territorial Forms' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) agreement_sub_type: Mapped[Optional[str]] = mapped_column( ENUM( 'territorial_distribution', 'territorial_rep', 'territorial_sub_rep', 'consulting', 'orchard_distribution_inducement_letter', 'orchard_rep_inducement_letter', ), comment="Sub type of agreement can be 'artist' or 'label'.", default=None, ) distributor_share: Mapped[Optional[float]] = mapped_column( Float, comment="The distributor's share of revenue", default=None ) orchard_share: Mapped[Optional[float]] = mapped_column( Float, comment='The orchard share of revenue', default=None ) based_on: Mapped[Optional[str]] = mapped_column( ENUM('gross', 'net', 'other'), comment='The share is based on ', default=None ) referral_fee: Mapped[Optional[float]] = mapped_column( Float, comment='The referral fee', default=None ) exclusive: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Yes or No indicates the exclusivity of this agreement.', default=None, ) distributor_shares_exclusivity: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not distributor shares exclusivity', default=None, ) other_distributors: Mapped[Optional[int]] = mapped_column( Integer, comment='The # of other distributors', default=None ) marketing_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not any marketing restrictions apply.', default=None, ) mfn: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not MFN applies.', default=None ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Whether or not there are restrictions on The Orchard's assignment rights", default=None, ) signup_fees_option: Mapped[Optional[str]] = mapped_column( ENUM('na', 'waived', 'waived_with_contingency'), comment='Sign up fees option', default=None, ) initial_retainer: Mapped[Optional[float]] = mapped_column( Float, comment='The initial retainer', default=None ) initial_retainer_recoupable: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not initial retainer is recoupable', default=None, ) monthly_retainer: Mapped[Optional[float]] = mapped_column( Float, comment='Monthly retainer', default=None ) monthly_retainer_recoupable: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Whether or not monthly retainer is recoupable', default=None, ) content_agreement_secured_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Content agreement secured fee', default=None ) content_agreement_secured_fee_based_on: Mapped[Optional[str]] = mapped_column( ENUM('gross', 'net', 'other'), comment='content agreement secured fee based on', default=None, ) representative_fee_type: Mapped[Optional[str]] = mapped_column( ENUM( 'targets', 'percentage_orchard_share', 'russian', 'amdl', 'sliding_percentage', ), comment='Representative fee type', default=None, ) percentage_orchard_share: Mapped[Optional[float]] = mapped_column( Float, comment='Percentage of orchard share', default=None ) representative_fee_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes for representative fees', default=None, ) label_contract_renewal_reduction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment="Whether or not representative fee be reduced if label's contract is renewed.", default=None, ) class AgreementMinTarget(Base): __tablename__ = 'agreement_min_target' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'Hold min target information for agreements with type territo'}, ) agreement_min_target_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) fees_attained: Mapped[Optional[float]] = mapped_column( Float, comment='Fees attained when the target is achieved.', default=None ) agreement_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to agreement table.', default=None ) min_target: Mapped[Optional[float]] = mapped_column( Float, comment='Min target amount', default=None ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Start date', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='End date of the target', default=None ) target_type: Mapped[Optional[str]] = mapped_column( ENUM('incentive_track_unit', 'incentive_release_unit'), server_default=text("'incentive_track_unit'"), comment='The type of target', default=None, ) incentive_applicable_from: Mapped[Optional[str]] = mapped_column( ENUM('current_quarter', 'current_year', 'next_quarter', 'current_term', 'date'), comment='Incetive applicable time period', default=None, ) incentive_applicable_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The incentive applicable date applied when "Specific Date" option is selected the type', default=None, ) class AgreementNote(Base): __tablename__ = 'agreement_note' __table_args__ = {'comment': 'Holds OA user comments on agreement'} agreement_note_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) agreement_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to agreement table.', ) note_text: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='context of the note', default=None, ) note_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='datetime at which user added/edited this agreement note', default=None, ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='orchadmin user id who edited/added this agreement note', default=None, ) class AgreementPublishingLiability(Base): __tablename__ = 'agreement_publishing_liability' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'Holds publishing liability information with particular agree'}, ) agreement_publishing_liability_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to agreement table.', ) publishing_liability_type: Mapped[Optional[str]] = mapped_column( ENUM('full_length_download', 'mastertone', 'ringback', 'video'), comment="Type of publishing liability. It can be one of 'full_length_download', 'mastertone', 'ringback', 'video'.", default=None, ) liable_party: Mapped[Optional[str]] = mapped_column( ENUM('label', 'orchard', 'service'), comment="Party who's liable. Can be one of 'label', 'orchard', 'service'", default=None, ) liability_territory: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), comment='List of territory ids that the agreement publishing liability is applied to.', default=None, ) class AgreementRecoupPromotion(Base): __tablename__ = 'agreement_recoup_promotion' __table_args__ = { 'comment': 'Holds recoupment promotion information with particular agree' } id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to agreement table.', default=None ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Start date of the recoup promotion.', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='End date of the recoup promotion.', default=None ) recoup_fees: Mapped[Optional[float]] = mapped_column( Float, comment='Recoup fee in float number.', default=None ) class AgreementRevenueRateTerritory(Base): __tablename__ = 'agreement_revenue_rate_territory' __table_args__ = ( Index('territory_id', 'territory_id'), {'comment': 'Holds territory information with particular revenue rate of '}, ) agreement_revenue_rate_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement_revenue_rate table.', ) territory_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to country table.', ) class AgreementRightsGranted(Base): __tablename__ = 'agreement_rights_granted' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'Hold rights granted information with particular agreements'}, ) agreement_rights_granted_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) rights: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Rights that are granted.', ) agreement_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to agreement table.', ) class AgreementSlidingPercentages(Base): __tablename__ = 'agreement_sliding_percentages' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'Holds orchard share and aggregator fee information with part'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to agreement table.', default=None ) start_orchard_share: Mapped[Optional[float]] = mapped_column( Float, comment="Starting number of Orchard's share.", default=None ) end_orchard_share: Mapped[Optional[float]] = mapped_column( Float, comment="Ending number of Orchard's share.", default=None ) start_aggregator_fee: Mapped[Optional[float]] = mapped_column( Float, comment="Starting number of Partner's share.", default=None ) end_aggregator_fee: Mapped[Optional[float]] = mapped_column( Float, comment="Ending number of Partner's share.", default=None ) class AgreementTerritory(Base): __tablename__ = 'agreement_territory' __table_args__ = { 'comment': 'Holds territory information with particular agreements' } agreement_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to agreement table.', ) territory_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to country table.', ) type: Mapped[str] = mapped_column( ENUM('regular', 'exclusive', 'restricted'), primary_key=True, server_default=text("'restricted'"), comment="Type of agreement territory. Can be one of 'regular','exclusive','restricted'.", ) class Alert(Base, CreateMixin): __tablename__ = 'alert' __table_args__ = ( Index('FK_alert', 'alert_type_id'), Index('alert_for', 'alert_for'), Index('alert_for_id', 'alert_for_id'), {'comment': 'Holds all alerts in the alert panel on mypage'}, ) alert_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date the alert is created.' ) description: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Descriptive text of the alert.', ) alert_for_id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='The system ID for vendor, artist or release.' ) alert_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to alert_type table.' ) link: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='URL link that brings the user to corresponding page where the alert is created for.', ) created_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table. Stores the id of the orchadmin user who created the alert.', default=None, ) alert_for: Mapped[Optional[str]] = mapped_column( ENUM('artist', 'release', 'vendor'), comment='Type that the alert is created for. Can be blank, vendor, artist or release.', default=None, ) class AlertRoles(Base): __tablename__ = 'alert_roles' __table_args__ = ( Index('orchadmin_role_id', 'orchadmin_role_id'), {'comment': 'Holds OA user role and alert relationship to restrict specif'}, ) alert_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to alert table.', ) orchadmin_role_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to orchadmin_roles table.', ) class AlertType(Base): __tablename__ = 'alert_type' __table_args__ = ( Index('alert_permission', 'alert_permission'), {'comment': 'Holds type name and description of an alert'}, ) alert_type_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) description: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Descriptive text of the alert type.', ) type: Mapped[str] = mapped_column( ENUM('marketing', 'relationship'), nullable=False, comment='Name of the alert type.', ) alert_permission: Mapped[str] = mapped_column( ENUM('group', 'individual'), nullable=False, server_default=text("'group'"), comment="Alert permission level. Can be 'group' or 'individual'.", ) class AlertTypeRoles(Base): __tablename__ = 'alert_type_roles' __table_args__ = ( Index('FK_alert_type_roles', 'orchadmin_role_id'), {'comment': 'Holds alert type and OA user role relationship to restrict s'}, ) alert_type_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to alert_type table.', ) orchadmin_role_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to orchadmin_roles table.', ) class AnalyticsEventTypes(Base): __tablename__ = 'analytics_event_types' analytics_event_type_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) analytics_event_type_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class AnalyticsEvents(Base): __tablename__ = 'analytics_events' __table_args__ = ( Index('FK_analytics_event_type_id', 'analytics_event_type_id'), Index('IDX_event_start_date', 'analytics_event_start_date'), ) analytics_event_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) analytics_event_type_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to analytics_event_types table.' ) analytics_event_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) analytics_event_start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False ) is_active: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) class ApiArtistCustomFields(Base): __tablename__ = 'api_artist_custom_fields' artist_custom_field_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(Integer, nullable=False) artist_id: Mapped[int] = mapped_column(Integer, nullable=False) app_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) artist_custom_field_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) artist_custom_field_value: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) artist_custom_field_datatype: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) class ApiDiscountedProduct(Base): __tablename__ = 'api_discounted_product' __table_args__ = (Index('FK_api_discounted_product', 'product_id'),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column(Integer, nullable=False) active: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'1'") ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) class ApiLabelCustomFields(Base): __tablename__ = 'api_label_custom_fields' label_custom_field_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(Integer, nullable=False) app_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) label_custom_field_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) label_custom_field_value: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) label_custom_field_datatype: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) class ApiPrivilege(Base): __tablename__ = 'api_privilege' api_privilege_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) privilege: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_permissions: Mapped[list['ApiPermissions']] = relationship( 'ApiPermissions', back_populates='api_privilege', init=False ) class ApiProductCategories(Base): __tablename__ = 'api_product_categories' api_product_category_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) api_images_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class ApiProductComments(Base): __tablename__ = 'api_product_comments' api_comment_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) api_product_version_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) rating: Mapped[Optional[int]] = mapped_column(Integer, default=None) comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class ApiProductLabelInstallationVerifiers(Base): __tablename__ = 'api_product_label_installation_verifiers' api_product_label_installation_verifier_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) request_token: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) request_secret: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) api_product_label_installation_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) class ApiProductLabelPurchases(Base): __tablename__ = 'api_product_label_purchases' api_product_label_purchase_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) purchase_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) label_vendor_map: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_product_version_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) label_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) access_status: Mapped[Optional[str]] = mapped_column( ENUM('unapproved', 'approved', 'disapproved', 'purchased'), default=None ) approval_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) vendor_order_number: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) api_product_label_token: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class ApiProductReqCats(Base): __tablename__ = 'api_product_req_cats' __table_args__ = ( Index('FK_api_product_req_cats_product_versions', 'api_product_version_id'), ) api_product_req_cat_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_product_version_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) api_category_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class ApiProductVideos(Base): __tablename__ = 'api_product_videos' __table_args__ = ( Index('FK_api_product_videos_product_versions', 'api_product_version_id'), ) api_product_video_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) video_url: Mapped[str] = mapped_column(MEDIUMTEXT, nullable=False) image: Mapped[str] = mapped_column( ENUM('0', '1'), nullable=False, server_default=text("'0'") ) api_product_version_id: Mapped[int] = mapped_column(Integer, nullable=False) class ApiResources(Base): __tablename__ = 'api_resources' api_resource_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) resource: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_permissions: Mapped[list['ApiPermissions']] = relationship( 'ApiPermissions', back_populates='api_resource', init=False ) class ApiRevenueModel(Base): __tablename__ = 'api_revenue_model' model_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) model_name: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False ) api_product_version_revenue_model: Mapped[list['ApiProductVersionRevenueModel']] = ( relationship( 'ApiProductVersionRevenueModel', back_populates='model', init=False ) ) class ApiRoles(Base): __tablename__ = 'api_roles' api_role_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) role: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) description: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_product_required_roles: Mapped[list['ApiProductRequiredRoles']] = relationship( 'ApiProductRequiredRoles', back_populates='api_role', init=False ) api_role_permissions: Mapped[list['ApiRolePermissions']] = relationship( 'ApiRolePermissions', back_populates='api_role', init=False ) class ApiStatistics(Base): __tablename__ = 'api_statistics' api_statistic_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_product_version_id: Mapped[int] = mapped_column(Integer, nullable=False) region: Mapped[str] = mapped_column(ENUM('production', 'sandbox'), nullable=False) api_method: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) number_of_calls: Mapped[int] = mapped_column(Integer, nullable=False) number_of_sucessfull_calls: Mapped[int] = mapped_column(Integer, nullable=False) number_of_error_calls: Mapped[int] = mapped_column(Integer, nullable=False) last_call_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) class ApiThrottling(Base): __tablename__ = 'api_throttling' api_throttling_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) last_request_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) api_access_count: Mapped[int] = mapped_column(Integer, nullable=False) api_product_version_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) api_method: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) upc: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) isrc: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) api_tokens: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class ArtistCustomEventCategories(Base): __tablename__ = 'artist_custom_event_categories' category_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) category_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) artist_custom_events: Mapped[list['ArtistCustomEvents']] = relationship( 'ArtistCustomEvents', back_populates='category', init=False ) class ArtistInfo(Base): __tablename__ = 'artist_info' __table_args__ = ( ForeignKeyConstraint( ['primary_photo_id'], ['artist_photos.artist_photo_id'], ondelete='SET NULL', onupdate='CASCADE', name='FK_artist_info_primary_photo', ), ForeignKeyConstraint( ['unique_artist_id'], ['unique_artist.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_unique_artist', ), Index('FK_artist_info_primary_photo', 'primary_photo_id'), Index('FK_unique_artist', 'unique_artist_id'), Index('artist_name', 'name'), Index('orchard_country', 'orchard_country'), Index('pk_artist_name_vendor_id', 'artist_id', 'name', 'vendor_id'), Index('uidx_vendor_name', 'vendor_id', 'name', unique=True), Index('vendor_id', 'vendor_id'), {'comment': 'Main artists under a label'}, ) artist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) when_entered: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date when the artist entered into the database.', ) entered_by: Mapped[str] = mapped_column( String(64, 'utf8mb4_general_ci'), nullable=False, comment='Foreign key to orchadmin_users table. Stores the id of the orchadmin user who entered this artist into OA content.', ) artist_type: Mapped[str] = mapped_column( ENUM('artist', 'film_collection', 'tv_artist'), nullable=False, server_default=text("'artist'"), comment='Which product type this artist belong to', ) url: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), comment='URL of the artist profile.', default=None, ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of this artist.', default=None, ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist.', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table.', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the artist information was last updated.', default=None, ) join_artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to artist_info_tmp table.', default=None ) myspace_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Artist MySpace URL.', default=None ) myspace_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Myspace friend ID for the url provided.', default=None ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='City which this artist belongs.', default=None, ) address_state: Mapped[Optional[int]] = mapped_column( INTEGER, comment='State id of the state which this artist belongs in US', default=None, ) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='State id of the state which this artist belongs outside US', default=None, ) orchard_country: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Country id of the country which this artist belongs', default=None, ) active: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y', '-'), server_default=text("'-'"), comment='indicates whether the artist is active', default=None, ) tms_id: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) primary_photo_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) youtube_mytourdate_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) twitter_mytourdate_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist_email: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) unique_show_id: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), comment='Unique show id for TV series', default=None, ) isni_id: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) unique_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) primary_photo: Mapped[Optional['ArtistPhotos']] = relationship( 'ArtistPhotos', foreign_keys=[primary_photo_id], back_populates='artist_info', init=False, ) unique_artist: Mapped[Optional['UniqueArtist']] = relationship( 'UniqueArtist', back_populates='artist_info', init=False ) artist_photos: Mapped[list['ArtistPhotos']] = relationship( 'ArtistPhotos', foreign_keys='[ArtistPhotos.artist_id]', back_populates='artist', init=False, ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='artist', init=False ) artist_carveout_template: Mapped[list['ArtistCarveoutTemplate']] = relationship( 'ArtistCarveoutTemplate', back_populates='artist', init=False ) artist_custom_events: Mapped[list['ArtistCustomEvents']] = relationship( 'ArtistCustomEvents', back_populates='artist', init=False ) artist_info_profile_completion: Mapped[list['ArtistInfoProfileCompletion']] = ( relationship('ArtistInfoProfileCompletion', back_populates='artist', init=False) ) artist_marketable_events: Mapped[list['ArtistMarketableEvents']] = relationship( 'ArtistMarketableEvents', back_populates='artist', init=False ) artist_press: Mapped[list['ArtistPress']] = relationship( 'ArtistPress', back_populates='artist', init=False ) artist_social_connections: Mapped[list['ArtistSocialConnections']] = relationship( 'ArtistSocialConnections', back_populates='artist', init=False ) artist_url: Mapped[list['ArtistUrl']] = relationship( 'ArtistUrl', foreign_keys='[ArtistUrl.artist_id]', back_populates='artist', init=False, ) artist_url_: Mapped[list['ArtistUrl']] = relationship( 'ArtistUrl', foreign_keys='[ArtistUrl.artist_id]', back_populates='artist_', init=False, ) artist_videos: Mapped[list['ArtistVideos']] = relationship( 'ArtistVideos', back_populates='artist', init=False ) artist_yt_delivery_settings: Mapped[list['ArtistYtDeliverySettings']] = ( relationship('ArtistYtDeliverySettings', back_populates='artist', init=False) ) tour_dates: Mapped[list['TourDates']] = relationship( 'TourDates', back_populates='artist', init=False ) artist_social_preferences: Mapped[list['ArtistSocialPreferences']] = relationship( 'ArtistSocialPreferences', back_populates='artist', init=False ) tv_series_artist_mapping: Mapped[list['TvSeriesArtistMapping']] = relationship( 'TvSeriesArtistMapping', back_populates='artist', init=False ) api_invoices: Mapped[list['ApiInvoices']] = relationship( 'ApiInvoices', back_populates='artist', init=False ) product_transfer_history: Mapped[list['ProductTransferHistory']] = relationship( 'ProductTransferHistory', foreign_keys='[ProductTransferHistory.destination_artist_id]', back_populates='destination_artist', init=False, ) product_transfer_history_: Mapped[list['ProductTransferHistory']] = relationship( 'ProductTransferHistory', foreign_keys='[ProductTransferHistory.source_artist_id]', back_populates='source_artist', init=False, ) release_artist: Mapped[list['ReleaseArtist']] = relationship( 'ReleaseArtist', back_populates='artist_info', init=False ) track_artist: Mapped[list['TrackArtist']] = relationship( 'TrackArtist', back_populates='artist_info', init=False ) track_writer: Mapped[list['TrackWriter']] = relationship( 'TrackWriter', back_populates='artist_info', init=False ) class ArtistInfoConsolidation(Base): __tablename__ = 'artist_info_consolidation' vendor_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to vendor table.', ) from_artist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Primary Key.' ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist.', default=None ) to_artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Primary Key.', default=None ) class ArtistInfoProfileSections(Base): __tablename__ = 'artist_info_profile_sections' __table_args__ = {'comment': 'table for list of artist info profile sections'} section_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key', autoincrement=True, init=False ) section: Mapped[Optional[str]] = mapped_column( ENUM('info', 'tour_date', 'photos', 'videos', 'press', 'email', 'social'), server_default=text("'info'"), comment='name of the artist info profile section', default=None, ) weight: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) artist_info_profile_completion: Mapped[list['ArtistInfoProfileCompletion']] = ( relationship( 'ArtistInfoProfileCompletion', back_populates='section', init=False ) ) class ArtistName(Base): __tablename__ = 'artist_name' __table_args__ = ( Index('name', 'name'), {'comment': 'copy of artist names for search'}, ) artist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.' ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist.', default=None ) class ArtistPhotos(Base): __tablename__ = 'artist_photos' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_artist_photos_artist_info', ), Index('FK_artist_photos_artist_info', 'artist_id'), ) artist_photo_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) image_asset_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) caption: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) thumbnail_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='This column is deprecated. Need to be removed later', default=None, ) artist_info: Mapped[list['ArtistInfo']] = relationship( 'ArtistInfo', foreign_keys='[ArtistInfo.primary_photo_id]', back_populates='primary_photo', init=False, ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', foreign_keys=[artist_id], back_populates='artist_photos', init=False, ) artist_profilephoto_social_references: Mapped[ list['ArtistProfilephotoSocialReferences'] ] = relationship( 'ArtistProfilephotoSocialReferences', back_populates='photo', init=False ) class ArtistThumbnails(Base): __tablename__ = 'artist_thumbnails' __table_args__ = ( Index('FK_artist_photos_artist_info', 'artist_photo_id'), Index('FK_artist_photos_image_assets', 'image_asset_id'), ) artist_thumbnail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_photo_id: Mapped[int] = mapped_column(INTEGER, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ArtistWebImages(Base): __tablename__ = 'artist_web_images' __table_args__ = ( Index('FK_artist_photos_artist_info', 'artist_photo_id'), Index('FK_artist_photos_image_assets', 'image_asset_id'), ) artist_web_iamges_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_photo_id: Mapped[int] = mapped_column(INTEGER, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class Asset(Base): __tablename__ = 'asset' __table_args__ = ( Index('product_id', 'asset_type', 'product_id'), {'comment': 'Holds one sheet, marketing materials or marketing blurbs fil'}, ) asset_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) asset_type: Mapped[str] = mapped_column( ENUM('artist', 'release'), nullable=False, server_default=text("'artist'"), comment="Type of asset. Can be 'artist' or 'release'.", ) product_id: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'"), comment='ID of artist of upc of release. Foreign key to either aritst_info table or releases table.', ) asset_title: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Title/name of the asset.', ) asset_file_name: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='File name fo the asset.', ) bonus_material: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Indicates whether it is iTunes digial booklet', ) qc_notes: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether or not the pdf file contains qc notes.', default=None, ) class AudioAttributes(Base): __tablename__ = 'audio_attributes' id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) description: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) audio_attributes_suggestion_keywords: Mapped[ list['AudioAttributesSuggestionKeywords'] ] = relationship( 'AudioAttributesSuggestionKeywords', back_populates='audio_attribute', init=False, ) vendor_audio_attributes: Mapped[list['VendorAudioAttributes']] = relationship( 'VendorAudioAttributes', back_populates='audio_attribute', init=False ) track_audio_attributes: Mapped[list['TrackAudioAttributes']] = relationship( 'TrackAudioAttributes', back_populates='audio_attribute', init=False ) track_audio_attributes_changelog: Mapped[list['TrackAudioAttributesChangelog']] = ( relationship( 'TrackAudioAttributesChangelog', back_populates='audio_attribute', init=False, ) ) track_audio_attributes_edits: Mapped[list['TrackAudioAttributesEdits']] = ( relationship( 'TrackAudioAttributesEdits', back_populates='audio_attribute', init=False ) ) class B2bHisd(Base): __tablename__ = 'b2b_hisd' __table_args__ = ( Index('DEX_ROW_ID_IDX', 'DEX_ROW_ID', unique=True), Index('hisd_ITMGEDSC_idx', 'ITMGEDSC'), Index('hisd_PRSTADCD_idx', 'PRSTADCD'), Index('hisd_itemnmbr_idx', 'ITEMNMBR'), Index('hisd_itemnmbr_itmgedsc_idx', 'ITEMNMBR', 'ITMGEDSC'), Index('hisd_sku_idx', 'SKU'), Index('hisd_sopnumbe_idx', 'SOPNUMBE'), Index('hisd_soptype_idx', 'SOPTYPE'), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) SOPTYPE: Mapped[int] = mapped_column(SmallInteger, nullable=False) SOPNUMBE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ITEMNMBR: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ITEMDESC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) QUANTITY: Mapped[int] = mapped_column(SmallInteger, nullable=False) SHIPTONAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS1: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS2: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS3: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CITY: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) STATE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ZIPCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) COUNTRY: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_TS: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_ID: Mapped[int] = mapped_column( Integer, nullable=False, comment="'unique GreatPlains I" ) ITMGEDSC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'Label i" ) USCATVLS_6: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'project cod" ) SKU: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'UP" ) XTNDPRCE: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) QTYREMAI: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) UNITPRCE: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) LOCNCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) PRSTADCD: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class B2bHism(Base): __tablename__ = 'b2b_hism' __table_args__ = ( Index('DEX_ROW_ID_IDX', 'DEX_ROW_ID', unique=True), Index('hism_sopnumbe_idx', 'SOPNUMBE'), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) SOPTYPE: Mapped[int] = mapped_column(SmallInteger, nullable=False) SOPNUMBE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CUSTNMBR: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CUSTNAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ORDRDATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) INVODATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) PRSTADCD: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CNTCPRSN: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) SHIPTONAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS1: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS2: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS3: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CITY: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) STATE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ZIPCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) COUNTRY: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_TS: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) DEX_ROW_ID: Mapped[int] = mapped_column( Integer, nullable=False, comment="'unique GreatPlains I" ) VOIDSTTS: Mapped[int] = mapped_column(SmallInteger, nullable=False) DOCDATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) class B2bInventory(Base): __tablename__ = 'b2b_inventory' __table_args__ = ( Index('DEX_ROW_ID_IDX', 'DEX_ROW_ID', unique=True), Index('b2b_inv_ITMGEDSC_idx', 'ITMGEDSC'), Index('b2b_inv_itmnmbr_idx', 'ITEMNMBR'), Index('inv_locncode_idx', 'LOCNCODE'), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) IMPRINT: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, server_default=text("'Unknown'"), ) ARTIST: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) RELEASE_NAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, server_default=text("''") ) ITEMNMBR: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) QTYBKORD: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment="'B/" ) QTYRTRND: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment="'CSTRT" ) ORCHOHDQ: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment="'O" ) SKU: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'UP" ) ITEMDESC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'artist-releas" ) USCATVLS_6: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'project cod" ) DEX_ROW_ID: Mapped[int] = mapped_column( Integer, nullable=False, comment="'unique i" ) ITMGEDSC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'Label i" ) INV_DATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) QTYONORD: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) LOCNCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class B2bMutex(Base): __tablename__ = 'b2b_mutex' i: Mapped[int] = mapped_column(Integer, primary_key=True) class B2bTrd(Base): __tablename__ = 'b2b_trd' __table_args__ = ( Index('DEX_ROW_ID_IDX', 'DEX_ROW_ID', unique=True), Index('b2b_trd_itmnmbr_idx', 'ITEMNMBR'), Index('trd_PRSTADCD_idx', 'PRSTADCD'), Index('trd_itmgedsc_idx', 'ITMGEDSC'), Index('trd_locncode_idx', 'LOCNCODE'), Index('trd_sopnumbe_idx', 'SOPNUMBE'), Index('trd_soptype_idx', 'SOPTYPE'), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) SOPTYPE: Mapped[int] = mapped_column(SmallInteger, nullable=False) SOPNUMBE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ITEMNMBR: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ITEMDESC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) QUANTITY: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) SHIPTONAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS1: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS2: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS3: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CITY: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) STATE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ZIPCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) COUNTRY: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_TS: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_ID: Mapped[int] = mapped_column( Integer, nullable=False, comment="'unique GreatPlains I" ) ITMGEDSC: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'Label i" ) USCATVLS_6: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'project cod" ) SKU: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment="'UP" ) XTNDPRCE: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) QTYREMAI: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) UNITPRCE: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) LOCNCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) PRSTADCD: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class B2bTrm(Base): __tablename__ = 'b2b_trm' __table_args__ = ( Index('DEX_ROW_ID_IDX', 'DEX_ROW_ID', unique=True), Index('b2b_trm_sopnumbe_idx', 'SOPNUMBE'), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) SOPTYPE: Mapped[int] = mapped_column(SmallInteger, nullable=False) SOPNUMBE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CUSTNMBR: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CUSTNAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ORDRDATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) INVODATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) PRSTADCD: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CNTCPRSN: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) SHIPTONAME: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS1: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS2: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ADDRESS3: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) CITY: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) STATE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) ZIPCODE: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) COUNTRY: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) DEX_ROW_TS: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) DEX_ROW_ID: Mapped[int] = mapped_column( Integer, nullable=False, comment="'unique GreatPlains I" ) VOIDSTTS: Mapped[int] = mapped_column(SmallInteger, nullable=False) DOCDATE: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) class BfmTrackAssets(Base): __tablename__ = 'bfm_track_assets' __table_args__ = (Index('source_drive', 'source_drive'), Index('upc', 'upc')) upc: Mapped[int] = mapped_column(BIGINT, primary_key=True) track_code: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), primary_key=True, server_default=text("''") ) source_drive: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) source_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) dest_drive: Mapped[Optional[str]] = mapped_column( String(5, 'utf8mb4_general_ci'), default=None ) dest_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class BlacklistedSongs(Base): __tablename__ = 'blacklisted_songs' __table_args__ = (Index('track_name', 'track_name'),) blacklist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) type: Mapped[Optional[str]] = mapped_column( ENUM('publisher', 'master'), server_default=text("'publisher'"), default=None ) track_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) keywords: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) artist_keywords: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) songwriters: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) status: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) licensing_review_status: Mapped[list['LicensingReviewStatus']] = relationship( 'LicensingReviewStatus', back_populates='blacklist', init=False ) class BookedVendorContractSnapshot(Base): __tablename__ = 'booked_vendor_contract_snapshot' __table_args__ = ( Index('period_vendor', 'period_id', 'vendor_id', unique=True), Index('vendor_id', 'vendor_id'), {'comment': 'Holds ALL contracts of labels'}, ) contract_snapshot_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='PRIMARY key.', autoincrement=True, init=False ) insert_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) reserve_rate: Mapped[float] = mapped_column( FLOAT(10, 2), nullable=False, server_default=text("'0.00'") ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) vendor_contract_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='FOREIGN KEY TO vendor table.', default=None ) cont_start: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, server_default=text("'0000-00-00'"), comment='Contract START date.', default=None, ) cont_end: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, server_default=text("'9999-01-01'"), comment='Contract END date.', default=None, ) cont_version: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Contract version.', default=None ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('yes_digital', 'yes_physical', 'yes_both', 'no_both', 'y', 'n'), server_default=text("'no_both'"), comment="Yes OR NO indicates whether there''s exclusivity ON the contract.", default=None, ) orchrep_name: Mapped[Optional[str]] = mapped_column( String(55, 'utf8mb4_general_ci'), comment='NAME of the Orchard rep.', default=None, ) carve_out: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Deprecated', default=None ) qualification_level: Mapped[Optional[str]] = mapped_column( String(44, 'utf8mb4_general_ci'), server_default=text("'10,250,50,1000,50,1000'"), comment='Qualification LEVEL of the contract.', default=None, ) territory_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Countries that are restricted FROM the contract.', default=None, ) dms_carve_out: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='DMS customers that are restricted FROM the contract.', default=None, ) dms_master_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='DMS MASTER MASTER that are restricted FROM the contract.', default=None, ) encoding_fees_cap_back_ctlg: Mapped[Optional[float]] = mapped_column( Float, comment='Encoding fees cap FOR back catalogue.', default=None ) encoding_fees_cap_new_release: Mapped[Optional[float]] = mapped_column( Float, comment='Encoding fees cap FOR NEW releases.', default=None ) digital_split: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0.7'"), comment='Digital split BETWEEN label AND Orchard.', default=None, ) physical_split: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0.7'"), comment='Physical split BETWEEN label AND Orchard.', default=None, ) contract_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor_term', 'per_release_term'), server_default=text("'vendor_term'"), comment="TYPE of contract. VALUE can be 'vendor_term' OR 'per_release_term'.", default=None, ) release_term: Mapped[Optional[int]] = mapped_column( Integer, comment='Number of years FOR the contract IF the contract TYPE IS per_release_term.', default=None, ) advance_payment: Mapped[Optional[float]] = mapped_column( Float, comment='Advanced payment amount.', default=None ) advance_recoupable_percentage: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'1'"), comment='Advanced recoupable percentage.', default=None, ) dig_distribution_type: Mapped[Optional[str]] = mapped_column( ENUM('digital_mobile', 'digital_only', 'mobile_only'), server_default=text("'digital_mobile'"), comment="Digital distribution TYPE of the track. VALUE can be 'digital_mobile', 'digital_only', OR 'mobile_only'.", default=None, ) possible_track_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment="Yes OR NO indicates whether there's possible restrictions ON tracks.", default=None, ) oms_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), server_default=text("'none'"), comment="TYPE of OMS. VALUE can be 'none', 'both', 'orchard', OR 'label'.", default=None, ) oms_fee_percentage: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0.15'"), comment='OMS fee percentage.', default=None, ) negotiated_changes: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Yes OR NO indicates whether there's negotiated changes.", default=None, ) negotiated_change_comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Negotiated CHANGE COMMENT text.', default=None, ) contract_complete: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates IF the contract has been reviewed BY Legal AND marked AS completed.', default=None, ) signature_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='DATE of signature.', default=None ) marketing_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement has marketing restrictions.', default=None, ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement has orchard assignment right.', default=None, ) currency_id: Mapped[Optional[int]] = mapped_column( SMALLINT, server_default=text("'1'"), comment='FOREIGN KEY TO currency table.', default=None, ) third_party_responsibility: Mapped[Optional[str]] = mapped_column( ENUM('standard', 'other'), server_default=text("'standard'"), comment='Indicates whether the agreement has third party responsibility.', default=None, ) third_party_responsibility_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detail of third party responsibility.', default=None, ) possible_track_restriction_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detail of possible track_restrictions.', default=None, ) is_amendment: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement IS an amendment.', default=None, ) extend_until_recouped: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement should extend UNTIL recoupment.', default=None, ) sync_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Syncronization Admin Territory multi-SELECT dropdown of countries', default=None, ) sync_admin_commission: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Sync Admin Split textbox. Enter 0.75 FOR 75%', default=None, ) sync_admin_type_of_deal: Mapped[Optional[str]] = mapped_column( ENUM('master_admin', 'master_or_publishing_admin', 'publishing_admin_only'), comment='Sync Admin TYPE of Deal dropdown', default=None, ) royalty_collection_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Royalty Collection Territory Multi-SELECT dropdown of countries. ', default=None, ) royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0.7'"), comment='Royalty Collection Split textbox. Enter 0.75 FOR 75%', default=None, ) publishing_admin_commission: Mapped[Optional[float]] = mapped_column( Float, comment='Publishing Administration Split textbox. Enter 0.75 FOR 75%', default=None, ) publishing_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Publishing Admin Territory multi-SELECT dropdown of countries', default=None, ) publishing_admin_limit_grant_of_rights: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publishing Administration LIMIT GRANT of Rights FIELD', default=None, ) publishing_admin_misc_provisions: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publishing Administration Misc Previsions FIELD', default=None, ) parent_vendor_contract_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Contract id of the previous VERSION of this contract', default=None, ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), server_default=text("'vendor'"), comment='indicate whether this contract IS FOR Label OR OMS CLIENT', default=None, ) vendor_proposed_term_id: Mapped[Optional[int]] = mapped_column( Integer, comment='FOREIGN KEY referencing vendor proposed term TABLE', default=None, ) sync_admin_response_time: Mapped[Optional[int]] = mapped_column( Integer, comment='Sync Admin Response TIME textbox', default=None ) ringtone_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('both', 'label', 'orchard', 'none'), server_default=text("'none'"), comment='Take Ringtone Publishing dropdown', default=None, ) physical_track_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), server_default=text("'none'"), comment='Field to store physical track publishing ', default=None, ) unlimited_roll: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Unlimited Roll dropdown', default=None, ) rollover_length_in_months: Mapped[Optional[int]] = mapped_column( Integer, comment='Rollover LENGTH IN Months textfield', default=None ) can_terminate: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Can Terminate BEFORE Rollover ENDS dropdown', default=None, ) youtube_composition_clause: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) sx_royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) notice_required_in_days: Mapped[Optional[int]] = mapped_column( Integer, comment='Notice Required IN Days textbox', default=None ) term_continues_until_recouped: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Term Continues UNTIL Recouped dropdown', default=None, ) brand_split: Mapped[Optional[float]] = mapped_column( Float, comment="Label's Split - BRAND textfield IN edit vendor contract page", default=None, ) other_rights_option: Mapped[Optional[str]] = mapped_column( ENUM('any_and_all', 'other', 'none'), server_default=text("'any_and_all'"), comment='Other rights', default=None, ) other_rights_text: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Other rights TEXT FOR "other" OPTION', default=None, ) special_product_split: Mapped[Optional[float]] = mapped_column(Float, default=None) special_product_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) payment_interval: Mapped[Optional[str]] = mapped_column( ENUM('month', 'quarter'), server_default=text("'quarter'"), comment='How often the payment IS due', default=None, ) pay_after: Mapped[Optional[str]] = mapped_column( ENUM('30', '45', '60', '90'), server_default=text("'45'"), comment='Days BEFORE payment IS due', default=None, ) show_credit_card: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) opt_out: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes OR NO indicates whether OR NOT deliver content TO stores. DEFAULT N indicates, opt OUT IS FALSE AND content can be delivered', default=None, ) apply_fx_spread: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes OR NO indicates whether OR NOT TO apply FX Spread calculations during the monthly accounting PROCESS', default=None, ) orchard_compilation_agreement: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates the agreement FOR Orchard Compilation.', default=None, ) orchard_compilation_split: Mapped[Optional[float]] = mapped_column( Float, comment='Orchard Compilation Split(Label SHARE).', default=None ) orchard_compilation_authorization_required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether Authorization Required FOR Orchard Compilation.', default=None, ) number_of_months_before_payout: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) number_of_installments: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) contract_terms: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) service_type_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) class Calltype(Base): __tablename__ = 'calltype' __table_args__ = {'comment': 'Holds call type'} calltype_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) calltype: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Text of the call type.', ) class CarveoutChangeRelease(Base): __tablename__ = 'carveout_change_release' __table_args__ = ( Index( 'rel_id_day_hour_min_UK', 'release_id', 'day_added', 'hour_of_day', 'minute_of_day', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) day_added: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) hour_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) minute_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) class CarveoutChangeVendor(Base): __tablename__ = 'carveout_change_vendor' __table_args__ = ( Index( 'vendor_id_day_hour_min_UK', 'vendor_id', 'day_added', 'hour_of_day', 'minute_of_day', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) day_added: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) hour_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) minute_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) class CdReceive(Base): __tablename__ = 'cd_receive' __table_args__ = ( Index('orchadmin_user_id', 'orchadmin_user_id'), Index('upc', 'upc'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds asset status information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) date_received: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date when the cd was received.', ) rights_status: Mapped[str] = mapped_column( ENUM('not_evaluated', 'clear', 'dpd', 'no_rights'), nullable=False, server_default=text("'not_evaluated'"), comment="Stores the rights status. Can be 'not_evaluated', 'clear', 'dpd', or 'no_rights'.", ) asset_type: Mapped[str] = mapped_column( ENUM( 'cd', 'cd_r', 'file', 'harddrive', 'ftp', 'dvd', 'dvd_r', 'beta', 'superbeta', 'beta_cam', 'yousendit', 'release_builder', 'bulk_upload', ), nullable=False, server_default=text("'cd'"), comment='Type of asset.', ) image_scan: Mapped[str] = mapped_column( ENUM('Y', 'N', 'error', '-'), nullable=False, server_default=text("'-'"), comment="Indicates if there's image scan. Values can be 'Y', 'N', 'error', or '-'.", ) encoding: Mapped[str] = mapped_column( ENUM('Y', 'N', 'error'), nullable=False, server_default=text("'N'"), comment="Inidicates if there's encoding. Values can be 'Y', 'N', or 'error'.", ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table.', default=None ) total_tracks: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Number of total tracks for the release.', default=None ) artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist for this release.', default=None, ) release_name: Mapped[Optional[str]] = mapped_column( String(140, 'utf8mb4_general_ci'), comment='Release name of this release.', default=None, ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who entered this cd in OA.', default=None, ) image_scan_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the image scan.', default=None ) encoding_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of encoding.', default=None ) total_tracks_encoded: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Number of tracks encoded.', default=None ) harddrive_no: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Harddrive number where the tracks are.', default=None ) comment: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) qty_received: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Quantity of the cd received.', default=None ) video_mastered_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) video_tracks_mastered: Mapped[Optional[int]] = mapped_column( MEDIUMINT, default=None ) video_mastered: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) class Channel(Base): __tablename__ = 'channel' __table_args__ = { 'comment': 'Holds channel for product type movie, tv-show or video etc' } channel_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary key', autoincrement=True, init=False ) channel: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, comment='channel name. Used only for product type movie, tv show and video', ) class ChannelSequence(Base): __tablename__ = 'channel_sequence' __table_args__ = (Index('FK_vend_contact', 'user_id'),) channel_sequence_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) user_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vend_contact table.' ) channel_sequence: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) hidden_channel_sequence: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class CheckReceivable(Base, UpdateMixin): __tablename__ = 'check_receivable' __table_args__ = ( Index('check_date', 'check_date'), {'comment': 'Holds check receivable information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) check_no: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, comment='Stores the check number of the physical check.', ) check_amt: Mapped[decimal.Decimal] = mapped_column( Double(asdecimal=True), nullable=False, comment='Stores check amount paid.' ) pay_method: Mapped[str] = mapped_column( ENUM('check', 'ach/wire', 'money_order'), nullable=False, server_default=text("'check'"), comment="Payment method. Values can be 'check', 'ach/wire', or 'money_order'.", ) check_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date the check is received.' ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date the entry is entered into OA.' ) entered_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table. Stores ID of the orchadmin user who entered in this check entry.', ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the check_receivable record.', default=None, ) check_receivable_detail: Mapped[list['CheckReceivableDetail']] = relationship( 'CheckReceivableDetail', back_populates='check', init=False ) class Checkspaid(Base, UpdateMixin): __tablename__ = 'checkspaid' __table_args__ = ( Index('cut_date', 'cut_date'), Index('upc', 'upc'), {'comment': 'Holds check payable information'}, ) id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date of this check entry.', ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) check_payable: Mapped[str] = mapped_column( String(65, 'utf8mb4_general_ci'), nullable=False, comment='Name of the person/organization the check is paid to.', ) check_amt: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='Amount paid on the check.' ) cut_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date the check is cut.', ) cash_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date the check is cashed/deposited.', ) check_no: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Check number.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) paidfor_type: Mapped[Optional[str]] = mapped_column( ENUM('physical', 'digital', 'phy_recoupe', 'dig_recoupe'), comment="Type that the check is paid for. Values can be 'physical', 'digital', 'phy_recoupe', or 'dig_recoupe'.", default=None, ) paidfor_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) currency_id: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) amount_in_original_currency: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the checkspaid record.', default=None, ) class ClassificationDetail(Base): __tablename__ = 'classification_detail' id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) classification: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Store Classification.', ) category: Mapped[Optional[str]] = mapped_column( ENUM('revenue', 'non_revenue'), server_default=text("'revenue'"), comment='Store Category.', default=None, ) store: Mapped[list['CustomerMasterMaster']] = relationship( 'CustomerMasterMaster', secondary='store_classification_detail', back_populates='classification_detail', init=False, ) class ClientNotificationUrl(Base): __tablename__ = 'client_notification_url' __table_args__ = (Index('key_id', 'key_id'),) client_notification_url_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) callback_tokens: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False ) callback_url: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), default=None ) release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) key_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) key_type: Mapped[Optional[str]] = mapped_column( ENUM('release', 'asset_upload'), default=None ) client_notification_detail: Mapped[list['ClientNotificationDetail']] = relationship( 'ClientNotificationDetail', back_populates='client_notification_url', init=False ) class ClosedCaptionReasons(Base): __tablename__ = 'closed_caption_reasons' id: Mapped[int] = mapped_column( SmallInteger, primary_key=True, comment='Primary key ', autoincrement=True, init=False, ) reason_code: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Code for reason statement', default=None, ) reason_description: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Reason statement', default=None ) track: Mapped[list['Track']] = relationship( 'Track', back_populates='closed_caption_reason', init=False ) class CollectionSociety(Base): __tablename__ = 'collection_society' __table_args__ = ( Index('territory', 'territory'), {'comment': 'Holds list of collection societies that provide royalty coll'}, ) collection_society_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) collection_society: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False, comment='Name of the collection society for royalty collection', ) territory: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to country table that holds that country of operation for the society.', default=None, ) class CommingSoonRelease(Base): __tablename__ = 'comming_soon_release' __table_args__ = ( Index('genre_id', 'genre_id'), {'comment': 'Holds UPC and Start date of coming soon releases'}, ) upc: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'"), comment='Primary Key.' ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the release would be coming.', default=None ) genre_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to genre table. It Indicates which genre this release is of.', default=None, ) class Contact(Base, UpdateMixin): __tablename__ = 'contact' __table_args__ = ( Index('orchard_country', 'orchard_country'), {'comment': 'Holds contacts of Label and publisher'}, ) contact_last_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment="Contact's last name." ) contact_affiliation: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment="Contact's affiliation if any", ) contact_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) contact_first_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's first name.", default=None ) contact_middle_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's middle name.", default=None ) contact_email: Mapped[Optional[str]] = mapped_column( String(254, 'utf8mb4_general_ci'), default=None ) alt_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's alternative email address.", default=None, ) contact_comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comment text if any.', default=None, ) contact_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's title.", default=None ) affiliation_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Not used.', default=None ) address_street: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment="Contact's street address.", default=None, ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's address city.", default=None, ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's address zip/postal code.", default=None, ) address_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Foreign key to orchard_state table.', default=None, ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's fax number.", default=None ) contact_cell: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's cellphone number.", default=None, ) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's phone number.", default=None, ) contact_phone_2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's alternative phone number.", default=None, ) checks_remove: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Check payable to name.', default=None ) company: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's company.", default=None ) instrument: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment="Contact's instrument.", default=None ) address2: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment="Contact's street address line 2.", default=None, ) country: Mapped[Optional[str]] = mapped_column( String(70, 'utf8mb4_general_ci'), comment='No longer used.', default=None ) orchard_country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table.', default=None ) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment="Contact's address state if not found in orchard_state list.", default=None, ) contact_type: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Type of contact.', default=None ) send_option: Mapped[Optional[str]] = mapped_column( ENUM('certified_mail', 'courier', 'messenger', 'email', 'fax'), comment='Mail sending option.', default=None, ) address_last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) requested_login_email: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Auth0 email that this user should be associated with, once the vendor gets their welcome email.', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the contact record.', default=None, ) class Continent(Base): __tablename__ = 'continent' continent_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) continent: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class Country(Base): __tablename__ = 'country' __table_args__ = ( Index('abbrivation', 'abbrivation'), Index('country_code', 'country_code', unique=True), {'comment': 'Holds country names'}, ) id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='Name of the country.' ) abbrivation: Mapped[str] = mapped_column( CHAR(2, 'utf8mb4_general_ci'), nullable=False ) continent: Mapped[str] = mapped_column( ENUM( 'Africa', 'Antarctica', 'Asia', 'Europe', 'North America', 'Oceania', 'South America', ), nullable=False, ) country_code: Mapped[Optional[str]] = mapped_column( CHAR(2, 'utf8mb4_general_ci'), comment='ISO 3166-1 alpha-2 country code', default=None, ) latitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), comment='Latitude of the country', default=None ) longitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), comment='Longitude of the country', default=None ) iso3166a3: Mapped[Optional[str]] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), default=None ) continent_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) region: Mapped[list['Region']] = relationship( 'Region', secondary='region_country', back_populates='country', init=False ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='country', init=False ) artist_carveout_template: Mapped[list['ArtistCarveoutTemplate']] = relationship( 'ArtistCarveoutTemplate', back_populates='country', init=False ) tour_dates: Mapped[list['TourDates']] = relationship( 'TourDates', back_populates='country_', init=False ) zipcodes: Mapped[list['Zipcodes']] = relationship( 'Zipcodes', back_populates='country', init=False ) product_territory_split: Mapped[list['ProductTerritorySplit']] = relationship( 'ProductTerritorySplit', back_populates='country', init=False ) subaccount: Mapped[list['Subaccount']] = relationship( 'Subaccount', back_populates='country', init=False ) soundscan_codes: Mapped[list['SoundscanCodes']] = relationship( 'SoundscanCodes', back_populates='country', init=False ) subaccount_territory_restriction: Mapped[list['SubaccountTerritoryRestriction']] = ( relationship( 'SubaccountTerritoryRestriction', back_populates='country', init=False ) ) product_distribution: Mapped[list['ProductDistribution']] = relationship( 'ProductDistribution', back_populates='country', init=False ) subaccount_royalty_collection_territories: Mapped[ list['SubaccountRoyaltyCollectionTerritories'] ] = relationship( 'SubaccountRoyaltyCollectionTerritories', back_populates='country', init=False ) track_producer_nationality: Mapped[list['TrackProducerNationality']] = relationship( 'TrackProducerNationality', back_populates='nationality_country', init=False ) class CountryCurrencies(Base, CreateMixin): __tablename__ = 'country_currencies' country_id: Mapped[int] = mapped_column( SmallInteger, primary_key=True, server_default=text("'0'") ) currency_id: Mapped[int] = mapped_column( SmallInteger, primary_key=True, server_default=text("'0'") ) is_primary: Mapped[int] = mapped_column( TINYINT(1), primary_key=True, server_default=text("'0'") ) created_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) class CountryLanguage(Base): __tablename__ = 'country_language' country_language_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) country_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) languageCode: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) class CountryRatingAdvisorySystem(Base): __tablename__ = 'country_rating_advisory_system' __table_args__ = ( Index('country_id', 'country_id', 'rating_advisory_system', unique=True), ) country_rating_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) country_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) rating_advisory_system: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) class CsFunctionalArea(Base): __tablename__ = 'cs_functional_area' __table_args__ = { 'comment': 'Contains list of sections/areas for customer service.' } id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Name of the functional area.', default=None, ) class CsIssue(Base): __tablename__ = 'cs_issue' __table_args__ = ( Index('sub_functional_area_id', 'sub_functional_area_id'), Index('subject_id', 'subject_id'), {'comment': 'Contains list of pre-defined issues and resolutions that mig'}, ) issue_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) subject_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to cs_functional_area table.', ) issue: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Issue detail/description.', default=None, ) response: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Response detail/description.', default=None, ) sub_functional_area_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to cs_subfunctional_area table.', default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates if the issue is active.', default=None, ) class CsSubfunctionalArea(Base): __tablename__ = 'cs_subfunctional_area' __table_args__ = ( Index('functional_area_id', 'functional_area_id'), {'comment': 'Holds list of sub sections for customer service.'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) functional_area_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to cs_functional_area table.', default=None ) sub_functional_area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Name of the sub functional area.', default=None, ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Description of the sub functional area.', default=None, ) class Currencies(Base): __tablename__ = 'currencies' __table_args__ = (Index('ISO_4217_code_UNIQUE', 'ISO_4217_code', unique=True),) id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, autoincrement=True, init=False ) ISO_4217_code: Mapped[Optional[str]] = mapped_column( String(12, 'utf8mb4_general_ci'), default=None ) symbol_html_entity_code: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='Html entity of symbol', default=None ) currency_name: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='Name of currency.', default=None ) decimal_mark: Mapped[Optional[str]] = mapped_column( CHAR(1, 'utf8mb4_general_ci'), comment='Decimal mark', default=None ) thousands_separator: Mapped[Optional[str]] = mapped_column( CHAR(1, 'utf8mb4_general_ci'), comment='Thousand separator', default=None ) symbol_infront: Mapped[Optional[str]] = mapped_column( CHAR(1, 'utf8mb4_general_ci'), comment='Place symbol infront of dollar amount\n', default=None, ) subunit_to_unit: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Subunit of unit', default=None ) subunit_name: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='Name of subunit', default=None ) supported_payout_currency: Mapped[Optional[str]] = mapped_column( CHAR(1, 'utf8mb4_general_ci'), server_default=text("'N'"), comment='Orchard supported payout currency\n', default=None, ) agreement: Mapped[list['Agreement']] = relationship( 'Agreement', back_populates='currencies', init=False ) agreement_revenue_rate: Mapped[list['AgreementRevenueRate']] = relationship( 'AgreementRevenueRate', back_populates='currencies', init=False ) release_manual_adjustment: Mapped[list['ReleaseManualAdjustment']] = relationship( 'ReleaseManualAdjustment', back_populates='currencies', init=False ) class Currency(Base): __tablename__ = 'currency' __table_args__ = {'comment': 'Holds Currency abbrivations'} currency_id: Mapped[str] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), primary_key=True, comment='Currency code is ISO format.', ) currency: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Descriptive text indicating which currency.', ) release_payment_log: Mapped[list['ReleasePaymentLog']] = relationship( 'ReleasePaymentLog', back_populates='currency_', init=False ) api_invoice_payment_logs: Mapped[list['ApiInvoicePaymentLogs']] = relationship( 'ApiInvoicePaymentLogs', back_populates='currency_', init=False ) class CustomerMaster(Base): __tablename__ = 'customer_master' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('physical', 'physical'), Index('territory', 'territory'), {'comment': 'Holds DMS Substore data as well as physical stores data.'}, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Name of the DMS.' ) cust_type: Mapped[str] = mapped_column( ENUM('consignment', 'non_consignment'), nullable=False, server_default=text("'non_consignment'"), comment="Type of the DMS. Values can be 'consignment' or 'non_consignment'.", ) physical: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Indicates if the customer is Physical or not.', ) customer_master_master_id: Mapped[Optional[int]] = mapped_column( SMALLINT, server_default=text("'0'"), comment='Foreign key to customer_master_master table.', default=None, ) order_exp: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Order expense for the DMS.', default=None ) payment_term: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Payment term for the DMS in days.', default=None ) discount: Mapped[Optional[float]] = mapped_column( Float, comment='Discount percentage for the DMS.', default=None ) territory: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table. Indicates which country this DMS is servicing.', default=None, ) subaccount_dms_restriction: Mapped[list['SubaccountDmsRestriction']] = relationship( 'SubaccountDmsRestriction', back_populates='dms', init=False ) class CustomerMasterContact(Base): __tablename__ = 'customer_master_contact' __table_args__ = ( Index('country', 'country'), Index('customer_id', 'customer_id'), {'comment': 'Holds contacts of substore'}, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) master: Mapped[str] = mapped_column( ENUM('yes', 'no'), nullable=False, server_default=text("'no'"), comment='Yes or No indicates if this is the master contact.', ) sendemail: Mapped[str] = mapped_column( ENUM('yes', 'no'), nullable=False, server_default=text("'no'"), comment='Yes or No indicates if the DMS wants email sent to them.', ) customer_master_contact_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincrement Primary Key', autoincrement=True, init=False, ) contact_type: Mapped[str] = mapped_column( ENUM('marketing', 'operations'), nullable=False, server_default=text("'marketing'"), comment='Enumeration indicates whether customer contact is for Marketing or Operstions Department.', ) contact_title: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Title for contact' ) contact_first_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='contact first name' ) contact_last_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='contact last name' ) address_state: Mapped[int] = mapped_column(TINYINT, nullable=False, comment='state') country: Mapped[int] = mapped_column(SMALLINT, nullable=False, comment='country') delivery_interval: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Flashlight Delivery interval in days', default=None ) local_focus_territory: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='List of territory to be used for local focus', default=None, ) delivery_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date when delivery notification will start.', default=None, ) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Contact phone number', default=None ) contact_phone_2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Secondary contact phone', default=None, ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='contact fax number', default=None ) contact_cell: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='contact cell number', default=None ) contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='contact email address', default=None ) alt_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='alternate email address for contact', default=None, ) address_street: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), comment='street address', default=None ) address2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='street address line two', default=None, ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='city', default=None ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='zip code', default=None ) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='other state field if not a US state.', default=None, ) delivery_sections_list: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Flashlight Delivery Sections to be displayed in email sent', default=None, ) delivery_genre_ids: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Foreign key to Genre.', default=None, ) dateupdated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class CustomerMasterDistributionType(Base): __tablename__ = 'customer_master_distribution_type' __table_args__ = ( Index('customer_id', 'customer_id'), Index('distribution_type_id', 'distribution_type_id'), {'comment': 'Holds distribution types allowed to substores'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key', autoincrement=True, init=False, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table' ) distribution_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to distribution_type table.' ) distribution_features_ids: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Reference to distribution_features table.', default=None, ) class CustomerMasterMaster(Base): __tablename__ = 'customer_master_master' __table_args__ = ( Index('status', 'status'), {'comment': 'Holds master store information'}, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Name of the DMS master.', ) delivery_option: Mapped[str] = mapped_column( ENUM('full', 'cherry_pick', 'filtered_catalog'), nullable=False, server_default=text("'full'"), comment='The delivery option to be used for the Customer', ) show_delivery_info: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Flag to show/hide delivery information in edit customer master master page', ) encoding_order_status: Mapped[str] = mapped_column( ENUM('close', 'open'), nullable=False, server_default=text("'open'"), comment='Enum indicates what will be the status of automatically generated encoding order.', ) status: Mapped[str] = mapped_column( ENUM( 'active', 'inactive', 'terminated', 'onboarding', 'reporting only', 'suspended', ), nullable=False, server_default=text("'active'"), ) label_store: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Store specific to a label', ) is_user_defined_contributors_supported_last_updated: Mapped[datetime.datetime] = ( mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) ) sony_dms_code: Mapped[Optional[str]] = mapped_column( String(3, 'utf8mb4_general_ci'), comment='Three alpha code for the DMS from Sony.', default=None, ) ci_dms_code: Mapped[Optional[str]] = mapped_column( String(5, 'utf8mb4_general_ci'), comment='Apha code for the DMS used by CI', default=None, ) product_type_id: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='product type drop down in edit customer master master page', default=None, ) delivery_cap: Mapped[Optional[int]] = mapped_column( INTEGER, comment='delivery cap textbox in edit customer master page. It only show up if the delivery option is cherry picking. This field is used by the cherry picking report as one of the criteria for scoring, ranking the results', default=None, ) weekly_limit: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='# indicating how many reases to process for encoding in one week.', default=None, ) eo_limit: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='# indicating how many releases to have in one automatically created encoding order.', default=None, ) mv_delivery_option: Mapped[Optional[str]] = mapped_column( ENUM('full', 'cherry_pick'), server_default=text("'cherry_pick'"), comment='The Music Video delivery option to be used for the Customer', default=None, ) ddex_party_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Unique Ddex Party ID for the Customer', default=None, ) optin_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='opt in date to start deliver the content to store', default=None, ) required_genre_code: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Whether 'genre_code' for 'dms_master_genre' table is required or not.", default=None, ) required_subgenre_code: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Whether 'subgenre_code' for 'dms_master_subgenre' table is required or not.", default=None, ) required_subgenre: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="If 'Y' then dms_genre_mapping is required. If 'N' then 'dms_subgenre_mapping' is required.", default=None, ) instant_grat: Mapped[Optional[str]] = mapped_column( ENUM('Y'), comment='Y for instant grat enabled stores', default=None ) hd_only: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='To check whether stores accepts HD only', default=None, ) supports_timed_release: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) supports_timed_release_updated_by: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) supports_timed_release_last_updated: Mapped[Optional[datetime.datetime]] = ( mapped_column(NormalizedDateTime, default=None) ) supports_localization: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) supports_localization_updated_by: Mapped[Optional[int]] = mapped_column( Integer, default=None ) supports_localization_updated_by_date_time: Mapped[Optional[datetime.datetime]] = ( mapped_column(NormalizedDateTime, default=None) ) is_user_defined_contributors_supported: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) is_user_defined_contributors_supported_updated_by: Mapped[Optional[int]] = ( mapped_column(INTEGER, default=None) ) exclusive_audio_content: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) updated_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) classification_detail: Mapped[list['ClassificationDetail']] = relationship( 'ClassificationDetail', secondary='store_classification_detail', back_populates='store', init=False, ) language: Mapped[list['Language']] = relationship( 'Language', secondary='dms_preferred_meta_language', back_populates='customer_master_master', init=False, ) dms_master_genre: Mapped[list['DmsMasterGenre']] = relationship( 'DmsMasterGenre', back_populates='customer_master_master', init=False ) dms_preferred_artist_country: Mapped[list['DmsPreferredArtistCountry']] = ( relationship( 'DmsPreferredArtistCountry', back_populates='customer_master_master', init=False, ) ) dms_preferred_genre: Mapped[list['DmsPreferredGenre']] = relationship( 'DmsPreferredGenre', back_populates='customer_master_master', init=False ) dms_preferred_label: Mapped[list['DmsPreferredLabel']] = relationship( 'DmsPreferredLabel', back_populates='customer_master_master', init=False ) dms_preferred_label_country: Mapped[list['DmsPreferredLabelCountry']] = ( relationship( 'DmsPreferredLabelCountry', back_populates='customer_master_master', init=False, ) ) dms_preferred_label_priority: Mapped[list['DmsPreferredLabelPriority']] = ( relationship( 'DmsPreferredLabelPriority', back_populates='customer_master_master', init=False, ) ) dms_preferred_marketing_priority: Mapped[list['DmsPreferredMarketingPriority']] = ( relationship( 'DmsPreferredMarketingPriority', back_populates='customer_master_master', init=False, ) ) dms_preferred_subaccount: Mapped[list['DmsPreferredSubaccount']] = relationship( 'DmsPreferredSubaccount', back_populates='customer_master_master', init=False ) dms_preferred_subgenre: Mapped[list['DmsPreferredSubgenre']] = relationship( 'DmsPreferredSubgenre', back_populates='customer_master_master', init=False ) dms_territory_currency: Mapped[list['DmsTerritoryCurrency']] = relationship( 'DmsTerritoryCurrency', back_populates='customer_master_master', init=False ) store_exception: Mapped[list['StoreException']] = relationship( 'StoreException', back_populates='store', init=False ) supply_chain_defaults: Mapped[list['SupplyChainDefaults']] = relationship( 'SupplyChainDefaults', back_populates='supply_chain', init=False ) participant_identifier: Mapped[list['ParticipantIdentifier']] = relationship( 'ParticipantIdentifier', back_populates='store', init=False ) participant_external_link: Mapped[list['ParticipantExternalLink']] = relationship( 'ParticipantExternalLink', back_populates='store', init=False ) subaccount_dms_master_restriction: Mapped[ list['SubaccountDmsMasterRestriction'] ] = relationship( 'SubaccountDmsMasterRestriction', back_populates='customer_master_master', init=False, ) dms_ingestion_failed: Mapped[list['DmsIngestionFailed']] = relationship( 'DmsIngestionFailed', back_populates='store', init=False ) product_physical_supply_chain_metadata: Mapped[ list['ProductPhysicalSupplyChainMetadata'] ] = relationship( 'ProductPhysicalSupplyChainMetadata', back_populates='store', init=False ) dms_track_identifier: Mapped[list['DmsTrackIdentifier']] = relationship( 'DmsTrackIdentifier', back_populates='dms_master_master', init=False ) track_instant_grat: Mapped[list['TrackInstantGrat']] = relationship( 'TrackInstantGrat', back_populates='customer_master_master', init=False ) class CustomerMasterMasterContact(Base): __tablename__ = 'customer_master_master_contact' __table_args__ = ( Index('customer_id', 'customer_master_master_id'), {'comment': 'Holds maser store contact information'}, ) customer_master_master_contact_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Autoincrement Primary Key', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master_master table.', ) master: Mapped[str] = mapped_column( ENUM('yes', 'no'), nullable=False, server_default=text("'no'"), comment='Indicates whether or not the contact is the Main/Master contact for the Customer.', ) sendemail: Mapped[str] = mapped_column( ENUM('yes', 'no'), nullable=False, server_default=text("'no'"), comment='Yes or No indicates if the DMS wants email sent to them.', ) delivery_interval: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Flashlight Delivery interval in days' ) local_focus_territory: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='List of territory to be used for local focus', ) contact_type: Mapped[str] = mapped_column( ENUM( 'marketing', 'operations', 'delivery_notification', 'correction', 'deletion', 'correction_ringtone', 'deletion_ringtone', 'delivery_verification', ), nullable=False, server_default=text("'marketing'"), comment='Indicates the contact type.', ) contact_first_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='First name of the primary contact of the digital service provider master store', ) contact_last_name: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Last name of the primary contact of the digital service provider master store', ) contact_email: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Email of the primary contact of the digital service provider master store', ) delivery_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Indicates the date when the delivery notification will start.', default=None, ) contact_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='contact title of the primary contact of the digital service provider master store', default=None, ) alt_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Alternative Email of the primary contact of the digital service provider master store', default=None, ) address_street: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), comment='Street address of the primary contact of the digital service provider master store', default=None, ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='City of the primary contact of the digital service provider master store', default=None, ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Zip code of the primary contact of the digital service provider master store', default=None, ) address_state: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='State of the primary contact of the digital service provider master store', default=None, ) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Phone of the primary contact of the digital service provider master store', default=None, ) contact_phone_2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Alternative phone of the primary contact of the digital service provider master store', default=None, ) contact_cell: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Mobile phone number of the primary contact of the digital service provider master store', default=None, ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Fax of the primary contact of the digital service provider master store', default=None, ) address2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Additional address information of the primary contact of the digital service provider master store', default=None, ) country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Country of the primary contact of the digital service provider master store', default=None, ) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='State that is not within US', default=None, ) delivery_genre_ids: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Foreign key to Genre.', default=None, ) delivery_sections_list: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Flashlight Delivery Sections to be displayed in email sent', default=None, ) dateupdated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class CustomerMasterMasterDistributionType(Base): __tablename__ = 'customer_master_master_distribution_type' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('distribution_type_id', 'distribution_type_id'), {'comment': 'Holds distribution types allowed to master stores'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key pointing to customer master master table', ) distribution_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to distribution_type table.' ) distribution_features_ids: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Reference to distribution_features table.', ) class CustomerOrder(Base): __tablename__ = 'customer_order' __table_args__ = ( Index('contact_id', 'contact_id'), Index('customer_id', 'customer_id'), Index('customer_ref_id', 'customer_ref_id'), {'comment': 'Holds customer order information'}, ) customer_order_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) contact_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to contact table.', ) customer_ref_id: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, comment='Customer reference number.', ) order_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date of the order.' ) payment_term: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Payment term for this order in days.' ) discount: Mapped[float] = mapped_column( Float, nullable=False, comment='Discount percentage for this order.' ) order_type: Mapped[str] = mapped_column( ENUM('new', 'bo'), nullable=False, server_default=text("'new'"), comment="Type of the order. Values can be 'new' or 'bo'. 'bo' stands for back order.", ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date of this order entry.' ) orchadmin_user: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchardmin_users table. Stores ID of the orchadmin user who entered in this order.', ) status: Mapped[str] = mapped_column( ENUM('hold', 'open', 'picking', 'closed', 'completed'), nullable=False, server_default=text("'hold'"), comment="Status of the order. Values can be 'hold', 'open', 'picking', 'closed', or 'completed'.", ) comment: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Comment text if any.', ) customer_master_contact_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master_contact table', ) invoice_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the invoice for this order.', default=None ) additional_charges: Mapped[Optional[float]] = mapped_column( Float, comment='Amount for additional charges if any for this order.', default=None, ) class CustomerReturn(Base): __tablename__ = 'customer_return' __table_args__ = ( Index('customer_id', 'customer_id'), Index('customer_ref_id', 'customer_ref_id'), {'comment': 'Contains list of pre-approved customer returns for physical '}, ) customer_return_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) customer_ref_id: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, comment='Customer reference number.', ) reason: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, comment='Reason for returning the order.', ) comment: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='Comment text if any.' ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date of the return order entry.' ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='foreign key to orchadmin_users table. Stores id of the orchadmin user who entered in this return request.', ) class CustomerService(Base): __tablename__ = 'customer_service' __table_args__ = ( Index('artist_id', 'artist_id'), Index('upc', 'upc'), Index('user_id', 'user_id'), {'comment': 'DEPRECATED'}, ) support_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, autoincrement=True, init=False ) date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) orchard_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) problemtype: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) description: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) email_comment: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) problem_status: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) solution: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class DealInfo(Base): __tablename__ = 'deal_info' __table_args__ = { 'comment': 'Holds information on potential deals with digital retailers.' } deal_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) aggrement_status: Mapped[Optional[str]] = mapped_column( ENUM('new', 'pitched', 'pending', 'verbal', 'signed', 'passed', 'inactive'), comment='Status of the agreement. Value can be "pitched", "pending", "verbal", "signed", "passed", or "inactive"', default=None, ) aggrement_status_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date when the agreement status is last updated.', default=None, ) contract_type: Mapped[Optional[str]] = mapped_column( ENUM('dms', 'mobile', 'dms_mobile'), comment='Type of the contract. Value can be "DMS", "Mobile", or "DMS & Mobile".', default=None, ) sub_contract_type: Mapped[Optional[str]] = mapped_column( ENUM( 'em', 'od', 'orchard', 'la_carte_us', 'la_carte_non_us', 'service_us', 'service_non_us', 'niche_us', 'niche_non_us', 'full_track_download_us', 'full_track_download_non_us', 'master_tone_us', 'master_tone_us', 'master_tone_ringback_us', 'master_tone_ringback_non_us', 'mobile_video', 'internet_video', ), comment='Sub type of the contract. Value can be "la_carte_us", "service_us", "la_carte_ont_us", "service_non_us", "niche_us", "niche_non_us", "full_track_download_us", "full_track_download_non_us", "master_tone_us", "master_tone_non_us", "master_tone_ringback_us"', default=None, ) owner: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Owner information of the deal.', default=None, ) territory_service: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='List of territory of service.', default=None, ) delivery_fees_tracks: Mapped[Optional[int]] = mapped_column( Integer, comment='Number of tracks.', default=None ) delivery_fees: Mapped[Optional[float]] = mapped_column( Float, comment='Initial delivery fees.', default=None ) format: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Format of the deal.', default=None ) company: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Company name.', default=None ) orchard_rep_id_1: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who is the first Orchard Rep.', default=None, ) orchard_rep_id_2: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who is the second Orchard Rep.', default=None, ) orchard_rep_id_3: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who is the third Orchard Rep.', default=None, ) priority: Mapped[Optional[int]] = mapped_column( Integer, comment='Priority number of the deal. Value can be 1, 2, 3, or 4.', default=None, ) company_info: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Company information or business model.', default=None, ) ongoing_delivery_fees: Mapped[Optional[float]] = mapped_column( Float, comment='Ongoing delivery fees of the deal.', default=None ) website: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Website URL.', default=None ) transfered: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the deal is transferred to OA.', default=None, ) dist_music_via: Mapped[Optional[str]] = mapped_column( ENUM('internet', 'mobile', 'both'), server_default=text("'internet'"), comment="Music distribution method. Value can be 'internet', 'mobile', or 'both'.", default=None, ) dist_types: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Music distribution types.', default=None, ) revenue_per_year: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Revenue per year of the company.', default=None, ) region: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Regions the company sells music.', default=None, ) current_labels: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Labels the company currently works with.', default=None, ) service_launched: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the service of the company has launched.', default=None, ) launch_date: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Date the service is launched.', default=None, ) funding: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Company funding situation.', default=None, ) distribution_content_type: Mapped[Optional[str]] = mapped_column( ENUM('music', 'video', 'both'), server_default=text("'music'"), comment="Distribution content type of the company. Value can be 'music', 'video' or 'both'.", default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='datetime at which this deal was added', default=None, ) delivery_option: Mapped[Optional[str]] = mapped_column( ENUM('full', 'cherry_pick'), comment='indicates whether this deal is cherry pick or full catalog', default=None, ) mv_delivery_option: Mapped[Optional[str]] = mapped_column( ENUM('full', 'cherry_pick'), server_default=text("'cherry_pick'"), comment='The Music Video delivery option to be used for the Customer', default=None, ) unique_users: Mapped[Optional[int]] = mapped_column(Integer, default=None) class DealInfoContact(Base): __tablename__ = 'deal_info_contact' __table_args__ = {'comment': 'Holds contact information on potential deals.'} deal_info_contact_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Foreign key referencing deal contact table', autoincrement=True, init=False, ) deal_id: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Foreign key to deal_info table.', default=None, ) contact_first_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='First name of primary contact of this deal', default=None, ) contact_last_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Last name of primary contact of this deal', default=None, ) contact_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Title of the primary contact of this deal', default=None, ) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Phone of primary contact of this deal', default=None, ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Fax of primary contact of this deal', default=None, ) contact_cell: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Mobile phone number of the primary contact of this deal', default=None, ) contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Email of the primary contact of this deal', default=None, ) address_street: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), comment='Street address of the primary contact of this deal', default=None, ) address2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Additional street address of the primary contact of this deal', default=None, ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='City of the primary contact of this deal', default=None, ) address_state: Mapped[Optional[int]] = mapped_column( Integer, comment='State of the primary contact of this deal', default=None ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Zip code of the primary contact of this deal', default=None, ) country: Mapped[Optional[int]] = mapped_column( Integer, comment='Country of the primary contact of this deal', default=None ) class DealInfoNotes(Base): __tablename__ = 'deal_info_notes' __table_args__ = {'comment': 'Holds notes regarding the deals.'} deal_info_note_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) deal_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to deal_info table.', default=None ) note_text: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='context of this note', default=None, ) note_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='date on which this note was created', default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='orchadmin user id of the user who added this deal info note', default=None, ) class DealInfoProductType(Base): __tablename__ = 'deal_info_product_type' deal_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='foreign key from deal_info table.' ) product_type_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='product type drop down in add-edit deal info page', ) class Deks(Base, CreateMixin): __tablename__ = 'deks' __table_args__ = ( Index('deactivated_at', 'deactivated_at'), Index('dek_type', 'dek_type'), Index('master_key_id', 'master_key_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) dek_type: Mapped[str] = mapped_column( ENUM('tin', 'helpcenter'), nullable=False, comment='Indicates what DEK is used to encrypt', ) encrypted_dek: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Encrypted DEK' ) master_key_id: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='KMS Master Key Id' ) deactivated_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='DEK Deactivation Timestamp', ) created_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='DEK Creation Timestamp', default=None, ) class DeliveryHistory(Base): __tablename__ = 'delivery_history' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('date_delivered', 'date_delivered'), Index('upc', 'upc'), ) delivery_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) encoder_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to encoder table.' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master table.' ) date_delivered: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date thie release is delivered to DMS.' ) package_size: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Total size of album delivered in Kbytes.' ) class DeliveryHistoryDeleted(Base): __tablename__ = 'delivery_history_deleted' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('date_delivered', 'date_delivered'), Index('upc', 'upc'), ) delivery_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) encoder_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to encoder table.' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master table.' ) date_delivered: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date the release is delivered to DMS.' ) package_size: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Total size of album delivered in Kbytes.' ) inserted_datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='When the row was inserted into this table', default=None, ) class DeliveryHistoryDetailDrop(Base): __tablename__ = 'delivery_history_detail_drop' __table_args__ = (Index('dms_customer_id', 'dms_customer_id'),) delivery_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Foreign key to delivery_history table.' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Foreign key to customer_master table.' ) class DetailedSalesImportError(Base): __tablename__ = 'detailed_sales_import_error' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), Index('download_date', 'download_date'), {'comment': 'Contains lines from detailed activity reports that could not'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincrement Primary Key', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='UPC for the album.' ) isrc: Mapped[str] = mapped_column( CHAR(12, 'utf8mb4_general_ci'), nullable=False, comment='ISRC code of the track.', ) sold_as: Mapped[str] = mapped_column( String(4, 'utf8mb4_general_ci'), nullable=False, comment='Field indicating the sold As type.', ) sales: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='The code indicates the sale type of the transaction.', ) download_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='The date the transaction occurred.' ) customer_store_name: Mapped[str] = mapped_column( String(10, 'utf8mb4_general_ci'), nullable=False, comment='The Code for the store.', ) not_processed: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Indicates whether or not the entry was processed.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign Key for the customer_master_master table.', ) vendor_identifier: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Vendor Identifier supplied by the DMS', default=None, ) artist: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Artist name for the track', default=None, ) title: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The track title.', default=None ) record_company: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The copyright label of the track.', default=None, ) royalty_price: Mapped[Optional[float]] = mapped_column( Float, comment='The potential royalty price of the transaction.', default=None ) po_number: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='PO Number related to the transaction.', default=None, ) zip_code: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='The zip code of the customer responsible for the transaction.', default=None, ) person_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Customer ID', default=None ) reporting_ymd: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The reporting date of the transaction.', default=None ) credit_flag: Mapped[Optional[str]] = mapped_column( String(5, 'utf8mb4_general_ci'), comment='Credit Flag', default=None ) customer_currency: Mapped[Optional[str]] = mapped_column( String(5, 'utf8mb4_general_ci'), comment='The currencty code for the store.', default=None, ) royalty_currency: Mapped[Optional[str]] = mapped_column( String(5, 'utf8mb4_general_ci'), comment='The currency code for the reported royatly.', default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date the entry was added into the database.', default=None, ) usd_total: Mapped[Optional[float]] = mapped_column( Float, comment='Total in USD', default=None ) class DigSales(Base, UpdateMixin): __tablename__ = 'dig_sales' __table_args__ = ( Index('check_detail_id', 'check_detail_id'), Index('dms_customer_id', 'dms_customer_id'), Index('period_id', 'period_id'), Index('quarter', 'quarter'), Index('year', 'year', 'quarter'), {'comment': 'Holds digital statement information.'}, ) statement_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) paid: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates if it is paid.', ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Statement year.' ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'"), comment='Statement quarter.', ) actual_statement_no: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), comment='Statement number.', default=None ) month: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Statement booked month.', default=None ) check_detail_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to checks_paid table.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) activity_rate: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Activity rate used to convert sale from original currency to USD', default=None, ) original_currency_id: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Currency of statement', default=None ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the dig_sales record.', default=None, ) class DigSalesDetail(Base): __tablename__ = 'dig_sales_detail' __table_args__ = ( Index('date', 'date'), Index('statement_id', 'statement_id'), Index('upc_cd_track_id', 'upc', 'cd', 'track_id'), ) statement_detail_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) statement_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'") ) date: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) cd: Mapped[int] = mapped_column(TINYINT, nullable=False) track_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) isrc: Mapped[str] = mapped_column(String(16), nullable=False) track_name: Mapped[str] = mapped_column(String(255), nullable=False) qty: Mapped[int] = mapped_column(Integer, nullable=False) total: Mapped[decimal.Decimal] = mapped_column(DECIMAL(18, 6), nullable=False) trans_type: Mapped[str] = mapped_column(CHAR(2), nullable=False) unit_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) retail_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) original_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) discount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) class DigSalesErrors(Base): __tablename__ = 'dig_sales_errors' __table_args__ = ( Index('date', 'date'), Index('isrc', 'isrc'), Index('statement_id', 'year'), Index('upc_cd_track_id', 'upc', 'cd', 'track_id'), {'comment': 'Contains list of digital sales that were in error during acc'}, ) statement_detail_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='foreign key to dig_sales_detial table', autoincrement=True, init=False, ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='statement booking year', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='statement booking quarter' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='foreign key to customer_master table' ) date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='date of the sales activity' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='foreign key to releases table' ) cd: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='volume number of the track' ) track_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='track number of the track' ) isrc: Mapped[str] = mapped_column( String(12, 'utf8mb4_general_ci'), nullable=False, comment='isrc of the track' ) track_name: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False, comment='track title of the track', ) qty: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='quantity of the sales' ) unit_price: Mapped[float] = mapped_column( Float, nullable=False, comment='unit price of the sales' ) total: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='transaction total of the sales' ) trans_type: Mapped[str] = mapped_column( CHAR(2, 'utf8mb4_general_ci'), nullable=False, comment='transaction type of the sales', ) retail_price: Mapped[float] = mapped_column( Float, nullable=False, comment='retail price of the sales' ) comment: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='comment associated with the sales', ) fixed: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Indicates whether or not the error was fixed.', ) processed: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Indicates whether or not this line was processed.', ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class DigitalDeletions(Base): __tablename__ = 'digital_deletions' __table_args__ = ( Index('upc', 'upc'), {'comment': 'Contains list of digital sales that were in error during acc'}, ) digital_deletion_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) cd: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='CD volume number of the track.' ) track_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Track number of the track.' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) date_deleted: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date the release is deleted.' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date this entry is last updated.', ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who deleted this release.', ) class DistributionFeatures(Base): __tablename__ = 'distribution_features' __table_args__ = ( Index('distribution_type_id', 'distribution_type_id'), {'comment': 'Holds distribution features'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='distribution feature name', default=None, ) distribution_type_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foriegn key to distribution_type table', default=None ) class DistributionFormatHfa(Base): __tablename__ = 'distribution_format_hfa' id: Mapped[int] = mapped_column( SmallInteger, primary_key=True, autoincrement=True, init=False ) hfa_configuration_code: Mapped[str] = mapped_column( String(2, 'utf8mb4_general_ci'), nullable=False ) context_type: Mapped[str] = mapped_column( ENUM('physical', 'digital'), nullable=False, server_default=text("'physical'") ) class DistributionFormatMedia(Base): __tablename__ = 'distribution_format_media' __table_args__ = {'comment': 'This table holds all media options for products.'} distribution_format_media_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) name: Mapped[str] = mapped_column(String(128, 'utf8mb4_general_ci'), nullable=False) distribution_format: Mapped[list['DistributionFormat']] = relationship( 'DistributionFormat', back_populates='distribution_format_media', init=False ) supply_chain_defaults: Mapped[list['SupplyChainDefaults']] = relationship( 'SupplyChainDefaults', back_populates='distribution_format_media', init=False ) class DistributionFormatMediaFormat(Base): __tablename__ = 'distribution_format_media_format' __table_args__ = { 'comment': 'This table holds all media format options for products.' } distribution_format_media_format_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) name: Mapped[str] = mapped_column(String(128, 'utf8mb4_general_ci'), nullable=False) distribution_format: Mapped[list['DistributionFormat']] = relationship( 'DistributionFormat', back_populates='distribution_format_media_format', init=False, ) class DistributionType(Base): __tablename__ = 'distribution_type' __table_args__ = { 'comment': 'Distribution type of labels, e.g. ringtone, full track, etc' } id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='primary key', autoincrement=True, init=False ) name: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, comment='distribution_type of a vendor, e.g. full track, ringtone, etc', ) class DmsAvailability(Base): __tablename__ = 'dms_availability' __table_args__ = ( Index('available', 'available'), Index('dms_customer_id', 'dms_customer_id'), ) upc: Mapped[int] = mapped_column( BIGINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to releases table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) available: Mapped[str] = mapped_column( ENUM('Y', 'N', 'P'), nullable=False, server_default=text("'Y'"), comment='Yes or No indicates if the release is available at the store.', ) date_available: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date when the release becomes available at the store.', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date this entry is last updated.', ) dms_unique_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Unique DMS code.', default=None ) class DmsDeletions(Base): __tablename__ = 'dms_deletions' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), Index('upc', 'upc'), {'comment': 'Stores the deletion takedown information for releases'}, ) dms_deletions_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) takedown_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date takedown was issued to store for this release.', ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) request_method: Mapped[str] = mapped_column( ENUM('xml', 'email'), nullable=False, server_default=text("'xml'"), comment='Type of deletion that was issued.', ) class DmsHdDelivery(Base): __tablename__ = 'dms_hd_delivery' __table_args__ = ( Index('agreement_id', 'agreement_id'), {'comment': 'deprecated - pending user confirmation'}, ) dms_hd_delivery_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to agreement table.', default=None ) entry_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Entry date of the HD delivery order.', default=None ) target_due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Target due date of the HD delivery order.', default=None, ) date_delivered: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the HD delivery order is delivered.', default=None ) shipping_cost: Mapped[Optional[float]] = mapped_column( Float, comment='Shipping cost of the HD delivery.', default=None ) shipping_method: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Shipping method of the HD delivery.', default=None, ) tracking_number: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Tracking number of the shipment of the HD delivery order.', default=None, ) delivery_type: Mapped[Optional[str]] = mapped_column( ENUM('init', 'update'), comment="Type of the delivery. Value can be 'init' or 'update'.", default=None, ) date_processing: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date this HD delivery order is entered into processing stage.', default=None, ) date_completed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date this HD delivery order is completed.', default=None, ) comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comment text if any.', default=None, ) priority: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Priority number of the HD delivery order.', default=None ) deal_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to deal_info table.', default=None ) class DmsHdDeliveryDetail(Base): __tablename__ = 'dms_hd_delivery_detail' __table_args__ = ( Index('dms_hd_delivery_id', 'dms_hd_delivery_id'), {'comment': 'deprecated - pending user confirmation'}, ) dms_hd_delivery_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_hd_delivery_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to dms_hd_delivery table.', ) number_hd: Mapped[Optional[int]] = mapped_column( Integer, comment='Number of HD in this order.', default=None ) hd_size: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='HD size for HD in this order.', default=None, ) total_tracks: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Number of total tracks on the HD in this order.', default=None ) class DmsHdPriority(Base): __tablename__ = 'dms_hd_priority' __table_args__ = { 'comment': 'Has the list of DMS & their priority for which the automated' } dms_master_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Foreign key referencing customer master master table', ) priority: Mapped[Optional[int]] = mapped_column( Integer, comment='Priority for the DMS while automatically generating HD encoding orders. Lower the number, higher the priority.', default=None, ) class DmsInvoice(Base, CreateMixin): __tablename__ = 'dms_invoice' __table_args__ = { 'comment': 'This table holds lists of invoices sent to DMS for hard driv' } invoice_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_master_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key the customer_master_master table.', default=None ) invoice_for: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Reason the invoice is prepared for.', default=None, ) invoice_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Invoice date.', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the invoice is created.', default=None ) invoice_to: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Party the invoice is prepared for.', default=None, ) address_1: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Street address.', default=None ) address_2: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Street address line 2.', default=None, ) city: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='City name.', default=None ) zip: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Zip/postal code.', default=None ) state: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Foreign key to orchard_state table.', default=None ) other_state: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='State/Province name if not listed in orchard_state list.', default=None, ) country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table.', default=None ) email: Mapped[Optional[str]] = mapped_column( VARCHAR(255), comment='Email address.', default=None ) paid: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates if it is paid.', default=None, ) dms_hd_delivery_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to dms_hd_delivery table.', default=None ) date_emailed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the invoice is emailed.', default=None ) created_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this invoice.', default=None, ) class DmsInvoiceDetail(Base): __tablename__ = 'dms_invoice_detail' __table_args__ = { 'comment': 'Contains details regarding invoice sent to DMS for HD delive' } invoice_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) description: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Descriptive text for this invoice detail entry.', ) amount: Mapped[decimal.Decimal] = mapped_column( DECIMAL(10, 4), nullable=False, server_default=text("'0.0000'"), comment='Amount for the detail entry in this invoice.', ) invoice_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to dms_invoice table.', default=None ) class DmsLinksEmail(Base): __tablename__ = 'dms_links_email' __table_args__ = (Index('vendor_id', 'vendor_id'),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key referencing vendor table', ) label_id: Mapped[Optional[str]] = mapped_column( String(26, 'utf8mb4_general_ci'), default=None ) itunes: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) class DmsMasterPricingScheme(Base): __tablename__ = 'dms_master_pricing_scheme' __table_args__ = ( Index( 'customer_master_master_id', 'customer_master_master_id', 'product_type_id' ), Index('product_type_id', 'product_type_id'), Index('scheme_level', 'scheme_level'), {'comment': 'Holds the pricing schemes for different product types&stores'}, ) pricing_scheme_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='primary key', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key referencing customer master master table', ) pricing_scheme: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='pricing scheme' ) product_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='product type id' ) default_pricing_tier: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='The default pricing tier id' ) scheme_level: Mapped[str] = mapped_column( ENUM('release', 'track'), nullable=False, server_default=text("'release'"), comment='Level of scheme', ) dms_master_pricing_scheme_territory: Mapped[ list['DmsMasterPricingSchemeTerritory'] ] = relationship( 'DmsMasterPricingSchemeTerritory', back_populates='pricing_scheme', init=False ) dms_pricing_tier: Mapped[list['DmsPricingTier']] = relationship( 'DmsPricingTier', back_populates='pricing_scheme', init=False ) class DmsMasterProductType(Base): __tablename__ = 'dms_master_product_type' customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='foreign key from customer_master_master table.', ) product_type_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='product type drop down in edit customer master master page', ) class DmsPlacement(Base): __tablename__ = 'dms_placement' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), {'comment': 'Stores placement information for particular services'}, ) placement_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) placement_name: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='Name of the placement.', ) placement_order: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Sort order of the placement.' ) active: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Yes or No indicates whether this placement is active.', ) class DmsPricing(Base): __tablename__ = 'dms_pricing' __table_args__ = ( Index( 'dms_customer_id', 'dms_customer_id', 'trans_type', 'year', 'quarter', unique=True, ), {'comment': 'deprecated'}, ) dms_pricing_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, autoincrement=True, init=False ) dms_customer_id: Mapped[int] = mapped_column(MEDIUMINT, nullable=False) price: Mapped[float] = mapped_column(Float, nullable=False) trans_type: Mapped[str] = mapped_column( ENUM('Download_Album', 'Download_Track', 'Streaming', 'Mobile'), nullable=False ) year: Mapped[int] = mapped_column(SMALLINT, nullable=False) quarter: Mapped[int] = mapped_column(TINYINT, nullable=False) class DmsUsersDelete(Base): __tablename__ = 'dms_users_delete' __table_args__ = {'comment': 'Stores login information for programming area'} dms_user_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) login: Mapped[str] = mapped_column( String(128, 'utf8mb4_general_ci'), nullable=False, comment='Username of the dms user.', ) password: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Password of the dms user.', ) f_name: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='First name of the dms user.', ) l_name: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='Last name of the dms user.', ) date_added: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date the dms user is added.', ) last_logged_in: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Last login date time of the dms user.', ) login_count: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Number of logins of this dms user.', ) company: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Company name of the dms user.', ) class DraOptoutResponses(Base): __tablename__ = 'dra_optout_responses' __table_args__ = ( Index('vendor_id', 'vendor_id', 'dra_optout_id', unique=True), {'comment': 'Holds DRA opt out response information'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign Key pointing to vendor table' ) dra_optout_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign Key point to dra_optout' ) class DraOptouts(Base): __tablename__ = 'dra_optouts' __table_args__ = ( Index( 'customer_master_master_id', 'customer_master_master_id', 'optout_deadline', unique=True, ), {'comment': 'Holds DRA opt-out stores, deadline and summary'}, ) dra_optout_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign Key pointing customer_master_master table', ) summary: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False, comment='Summary' ) optout_deadline: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Opt out deadline' ) class DsLicensee(Base): __tablename__ = 'ds_licensee' __table_args__ = { 'comment': 'DRA table holds lists of stores/DMS DRA had license with.' } licenseeid: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key (this table was imported from DRA db)', autoincrement=True, init=False, ) name: Mapped[str] = mapped_column( VARCHAR(30), nullable=False, server_default=text("''"), comment='licensee name' ) url: Mapped[str] = mapped_column( VARCHAR(100), nullable=False, server_default=text("''"), comment='URL' ) primaryphone: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='primary phone number', ) royaltyphone: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='royalty phone number', ) contentphone: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='content phone number', ) promotionsphone: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='promotions phone number', ) legalemail: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='legal email address', ) legalphone: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='legal phone number', ) city: Mapped[str] = mapped_column( VARCHAR(90), nullable=False, server_default=text("''"), comment='city' ) street1: Mapped[str] = mapped_column( VARCHAR(90), nullable=False, server_default=text("''"), comment='street line 1' ) street2: Mapped[str] = mapped_column( VARCHAR(90), nullable=False, server_default=text("''"), comment='street line 2' ) state: Mapped[str] = mapped_column( CHAR(2), nullable=False, server_default=text("''"), comment='state' ) xmlurl: Mapped[str] = mapped_column( VARCHAR(60), nullable=False, server_default=text("''"), comment='XML URL' ) primaryemail: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='primary email address', default=None ) royaltyemail: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='royalty email address', default=None ) contentemail: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='content email address', default=None ) promotionsemail: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='promotions email address', default=None ) primaryname: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='primary name', default=None ) royaltyname: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='royalty name', default=None ) contentname: Mapped[Optional[str]] = mapped_column( VARCHAR(200), comment='content name', default=None ) notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='notes', default=None ) marketingname: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='marketing name', default=None ) marketingemail: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='marketing email address', default=None, ) marketingphone: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='marketing phone number', default=None ) class DsLsdroyalty(Base): __tablename__ = 'ds_lsdroyalty' __table_args__ = ( Index('a_l_s', 'albumid', 'songid', 'labelid'), Index('datecreated', 'datecreated'), Index('dtidx', 'deliverytype'), Index('isrc', 'isrc'), Index('lblidx', 'labelid'), Index('temp_idx', 'licenseeid', 'datecreated', 'isrc'), Index('ttidx', 'territoryid'), {'comment': 'DRA table holds historical digital revenue from DRA'}, ) licenseeid: Mapped[int] = mapped_column(TINYINT, nullable=False) amount: Mapped[float] = mapped_column(Float, nullable=False) numtimes: Mapped[int] = mapped_column(MEDIUMINT, nullable=False) datecreated: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) isrc: Mapped[str] = mapped_column(CHAR(16, 'utf8mb4_general_ci'), nullable=False) deliverytype: Mapped[str] = mapped_column( ENUM( '', 'Internet Radio', 'Master Ringtone', 'OTA', 'Permanent Download', 'Polyphonic Ringtone', 'Subscription Download', 'Subscription Play', ), nullable=False, ) oldisrc: Mapped[str] = mapped_column( String(19, 'utf8mb4_general_ci'), nullable=False ) lsdid: Mapped[int] = mapped_column(INTEGER, primary_key=True) territoryid: Mapped[int] = mapped_column(TINYINT, nullable=False) upc: Mapped[str] = mapped_column(CHAR(20, 'utf8mb4_general_ci'), nullable=False) albumid: Mapped[int] = mapped_column(SMALLINT, nullable=False) songid: Mapped[int] = mapped_column(MEDIUMINT, nullable=False) labelid: Mapped[int] = mapped_column(SMALLINT, nullable=False) net_amount: Mapped[float] = mapped_column(Float, nullable=False) artist_name: Mapped[str] = mapped_column( String(151, 'utf8mb4_general_ci'), nullable=False ) release_name: Mapped[str] = mapped_column( String(123, 'utf8mb4_general_ci'), nullable=False ) track_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) class DupedArtistInfoMapping(Base): __tablename__ = 'duped-artist-info-mapping' artist_info_id: Mapped[int] = mapped_column(Integer, primary_key=True) corrected_artist_info_id: Mapped[int] = mapped_column(Integer, nullable=False) class EmailNotification(Base): __tablename__ = 'email_notification' __table_args__ = { 'comment': 'Stores a list of pre-defined email text for automated emails' } id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='primary key', autoincrement=True, init=False ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='description in email notification', default=None, ) section: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) class Emaillist(Base): __tablename__ = 'emaillist' listid: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) active: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'Y'") ) listname: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) createddate: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) createdby: Mapped[Optional[int]] = mapped_column(Integer, default=None) emaillistmembers_delete: Mapped[list['EmaillistmembersDelete']] = relationship( 'EmaillistmembersDelete', back_populates='emaillist', init=False ) class EmdReleases(Base): __tablename__ = 'emd_releases' __table_args__ = { 'comment': 'Contains list of UPC that denote EMD releases or releases th' } upc: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'"), comment='Foreign key to releases table.', ) class EmusicGenre(Base): __tablename__ = 'emusic_genre' __table_args__ = {'comment': 'deprecated'} id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), comment='Genre name', default=None ) class EmusicTrackMapping(Base): __tablename__ = 'emusic_track_mapping' __table_args__ = ( Index('emusic_track_id', 'emusic_track_id'), Index('isrc', 'isrc'), Index('upc', 'upc'), {'comment': "Stores eMusic's track ID, upc and isrc for tracks"}, ) emusic_track_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) isrc: Mapped[str] = mapped_column( CHAR(12, 'utf8mb4_general_ci'), nullable=False, comment='Track ISRC' ) class Encoder(Base): __tablename__ = 'encoder' __table_args__ = { 'comment': 'Holds list of encoders/methods used to deliver content to di' } encoder_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) encoder: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='Encoder name.' ) class EncoderDms(Base): __tablename__ = 'encoder_dms' __table_args__ = { 'comment': 'Links encoders and DMS indicating which encoders are allowed' } encoder_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to encoder table.', ) dms_master_customer_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Foreign key to customer_master_master table.', ) class EncodingOrder(Base): __tablename__ = 'encoding_order' __table_args__ = ( Index('encoder_delivery_date', 'encoder_delivery_date'), Index('encoder_id', 'encoder_id'), Index('entry_date', 'entry_date'), Index('meta_update', 'meta_update'), Index('orchadmin_user_id', 'orchadmin_user_id'), Index('order_status', 'order_status'), Index('type', 'type'), {'comment': 'Holds all encoding orders'}, ) encoding_order_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Entry date of the encoding order.' ) order_status: Mapped[str] = mapped_column( ENUM('open', 'close'), nullable=False, server_default=text("'open'"), comment='Status of the order. Value can be open or close.', ) type: Mapped[str] = mapped_column( ENUM('track', 'clip'), nullable=False, server_default=text("'track'"), comment="Type of the encoding order. Value can be 'track' or 'clip'. Clip type is no longer used since there's a separate section of database tables created.", ) clip_type: Mapped[str] = mapped_column( ENUM('both', 'ringtone', 'ringback'), nullable=False, server_default=text("'both'"), ) priority: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'2'") ) meta_update: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) processed: Mapped[str] = mapped_column( ENUM('Y', 'P', 'N'), nullable=False, server_default=text("'N'") ) encoder_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Foreign key to encoder table.', default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores ID of the orchadmin user who created this encoding order.', default=None, ) dms_list: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='List of DMS Ids that are associated with this order.', default=None, ) encoder_delivery_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Delivery date of this encoding order.', default=None ) due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) delivery_spec: Mapped[Optional[str]] = mapped_column( String(15, 'utf8mb4_general_ci'), default=None ) class EncodingOrderDetail(Base): __tablename__ = 'encoding_order_detail' __table_args__ = ( Index('encoding_order_id', 'encoding_order_id'), Index('upc', 'upc'), ) encoding_order_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) encoding_order_id: Mapped[int] = mapped_column(BIGINT, nullable=False) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) class EncodingOrderDetailDms(Base): __tablename__ = 'encoding_order_detail_dms' __table_args__ = (Index('dms_customer_id', 'dms_customer_id'),) encoding_order_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Foreign key to encoding_order_detail table.' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Foreign key to customer_master table.' ) class ExAArtistInfoDelete(Base): __tablename__ = 'ex_a_artist_info_delete' __table_args__ = ( Index('transfered', 'transfered'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds label copy artist information'}, ) artist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist.', default=None ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table.', default=None ) state_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchard_state table.', default=None ) other_state: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='State name if not found in orchard state list.', default=None, ) url: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), comment='Aritst profile URL.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Artist description.', default=None, ) bio: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Aritst biograhpical information.', default=None, ) transfered: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether this artist is transferred to OA content.', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date this entry is last updated.', default=None ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N', '-'), server_default=text("'-'"), default=None ) myspace_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) tms_id: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) class ExAArtistUrl(Base): __tablename__ = 'ex_a_artist_url' __table_args__ = ( Index('artist_id', 'artist_id'), {'comment': 'Holds URLs of label copy artists'}, ) url_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) artist_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to ex_a_artist_info table', default=None ) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='URL', default=None ) class Faq(Base): __tablename__ = 'faq' __table_args__ = ( Index('question_answer', 'question', 'answer'), {'comment': "Holds faq section's questions and answers"}, ) faq_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) question: Mapped[str] = mapped_column( String(200, 'utf8mb4_general_ci'), nullable=False ) answer: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) class FaqCategory(Base): __tablename__ = 'faq_category' __table_args__ = {'comment': 'Holds the category for the FAQ section in ALW.'} category_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) category: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False ) class FaqCategoryLink(Base): __tablename__ = 'faq_category_link' __table_args__ = ( Index('faq_category_id', 'faq_id', 'category_id', unique=True), {'comment': 'Links faq table to faq_category table.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) faq_id: Mapped[int] = mapped_column(INTEGER, nullable=False) category_id: Mapped[int] = mapped_column(INTEGER, nullable=False) t_fc_dig_sales_errors = Table( 'fc_dig_sales_errors', Base.metadata, Column('statement_detail_id', BIGINT, nullable=False), Column('year', SMALLINT, nullable=False, server_default=text("'0'")), Column('quarter', TINYINT, nullable=False), Column('dms_customer_id', MEDIUMINT, nullable=False), Column('date', NormalizedDate, nullable=False), Column('upc', BIGINT, nullable=False), Column('cd', TINYINT, nullable=False), Column('track_id', TINYINT, nullable=False), Column('isrc', CHAR(12, 'utf8mb4_general_ci'), nullable=False), Column('track_name', String(60, 'utf8mb4_general_ci'), nullable=False), Column('qty', MEDIUMINT, nullable=False), Column('unit_price', Float, nullable=False), Column('total', DECIMAL(18, 6), nullable=False), Column('trans_type', CHAR(2, 'utf8mb4_general_ci'), nullable=False), Column('retail_price', Float, nullable=False), Column('comment', String(100, 'utf8mb4_general_ci'), nullable=False), Column('fixed', ENUM('Y', 'N'), nullable=False, server_default=text("'N'")), Column('processed', ENUM('Y', 'N'), nullable=False, server_default=text("'N'")), comment='Financial close table holds list of dig sales items in error', ) class FcOwnerAccounting(Base): __tablename__ = 'fc_owner_accounting' __table_args__ = ( Index('owner_id', 'owner_id'), Index( 'unique_constraint', 'owner_id', 'year', 'quarter', 'entry_type', unique=True, ), {'comment': "Financial close table holds owner/partner's accounting entri"}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) owner_id: Mapped[int] = mapped_column(Integer, nullable=False) year: Mapped[int] = mapped_column(SmallInteger, nullable=False) quarter: Mapped[int] = mapped_column(TINYINT, nullable=False) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) entry_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) t_fc_processed_dig_sales = Table( 'fc_processed_dig_sales', Base.metadata, Column('statement_detail_id', BIGINT, nullable=False), Column('year', SMALLINT, nullable=False), Column('quarter', TINYINT, nullable=False), Column('dms_customer_id', MEDIUMINT, nullable=False), Column('date', NormalizedDate, nullable=False), Column('upc', BigInteger, nullable=False), Column('cd', TINYINT, nullable=False), Column('track_id', SMALLINT, nullable=False), Column('qty', MEDIUMINT, nullable=False), Column('actual_net', DECIMAL(18, 6), nullable=False), Column('adjusted_gross', DECIMAL(18, 6), nullable=False), Column('distribution_fees', DECIMAL(18, 6), nullable=False), Column('dpd_publishing', DECIMAL(18, 6), nullable=False), Column('gross', DECIMAL(18, 6), nullable=False), Column('net_receipt', DECIMAL(18, 6), nullable=False), Column('oms_fees', DECIMAL(18, 6), nullable=False), Column('partner_share', DECIMAL(18, 6), nullable=False), Column('ringtone_publishing', DECIMAL(18, 6), nullable=False), Column('trans_type', CHAR(2, 'utf8mb4_general_ci'), nullable=False), ) t_fc_processed_phy_sales = Table( 'fc_processed_phy_sales', Base.metadata, Column('id', MEDIUMINT, nullable=False, comment='Primary Key.'), Column('upc', BIGINT, nullable=False, comment='Foreign key to releases table.'), Column('quantity', Float, default=None), Column('amount', DECIMAL(18, 6), nullable=False), Column('year', SMALLINT, nullable=False, comment='Year of the sale.'), Column('quarter', TINYINT, nullable=False, comment='Quarter of the sale.'), Column('entry_type', String(50, 'utf8mb4_general_ci'), nullable=False), Column('related_id_type', ENUM('sales', 'creditmemo', 'cost'), nullable=False), Column('related_id', MEDIUMINT, nullable=False, comment='Type of the sales.'), Column( 'customer_id', MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.', ), ) t_fc_publisher_accounting = Table( 'fc_publisher_accounting', Base.metadata, Column('id', MEDIUMINT, nullable=False), Column('publisher_id', MEDIUMINT, nullable=False), Column('year', SMALLINT, nullable=False), Column('quarter', TINYINT, nullable=False), Column('amount', DECIMAL(18, 6), nullable=False), Column( 'entry_type', ENUM( 'balance_forward', 'carried_over_balance', 'opening_balance', 'royalty_payable', 'advances', 'outstanding_balance', 'ringtone_royalty', 'mechanical_royalty', 'server_fixation_fees', 'checkspaid', ), nullable=False, ), comment="Financial close table holds publisher's summarized accountin", ) class FcPublisherStatement(Base): __tablename__ = 'fc_publisher_statement' __table_args__ = ( Index('publisher_id', 'publisher_id'), {'comment': 'Financial close table holds list of publisher statements.'}, ) publisher_statement_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) publisher_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to publishers table.', ) date_added: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date the publisher statement is added.', ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Year of the publisher statement.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'"), comment='Quarter of the publisher statement.', ) t_fc_publisher_statement_detail = Table( 'fc_publisher_statement_detail', Base.metadata, Column( 'publisher_statement_detail_id', BIGINT, nullable=False, comment='Primary Key.' ), Column( 'publisher_statement_id', MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to publisher_statement table.', ), Column( 'track_id', INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to track table.', ), Column( 'dms_customer_id', MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ), Column( 'year', SMALLINT, comment='Year of the publisher statement detail item.', default=None, ), Column( 'quarter', TINYINT, comment='Quarter of the publisher statement detail item.', default=None, ), Column( 'trans_type', ENUM('DPD', 'DR', 'RB', 'SFF'), nullable=False, server_default=text("'DPD'"), comment="Transaction type. Value can be 'DT', 'DA', 'S', 'DR', 'TD', or 'RB'", ), Column( 'qty', INTEGER, comment='Quantity of the transaction for the track.', default=None, ), Column( 'ownership', Float, nullable=False, server_default=text("'0'"), comment='Ownership percentage of the track license for the publisher.', ), Column( 'royalty_rate', Float, nullable=False, server_default=text("'0'"), comment='Royalty rate of the track.', ), Column( 'royalty', Float, nullable=False, server_default=text("'0'"), comment='Royalty amount.', ), Column('license_no', INTEGER, nullable=False, comment='License number.'), comment='Financial close table holds detailed lines of royalty for ea', ) t_fc_publishing_escrow = Table( 'fc_publishing_escrow', Base.metadata, Column('escrow_id', MEDIUMINT, nullable=False), Column('statement_detail_id', BIGINT, nullable=False), Column('track_id', INTEGER, nullable=False), Column('dms_customer_id', MEDIUMINT, nullable=False), Column('year', SMALLINT, nullable=False), Column('quarter', TINYINT, nullable=False), Column('trans_type', String(4, 'utf8mb4_general_ci'), nullable=False), Column('qty', MEDIUMINT, nullable=False), Column('ownership', Float, nullable=False), Column('royalty_rate', Float, nullable=False), Column('royalty', DECIMAL(18, 6), nullable=False), comment='Financial close table holds publishing royalty in escrow wai', ) t_fc_release_accounting = Table( 'fc_release_accounting', Base.metadata, Column('id', MEDIUMINT, nullable=False), Column('upc', BigInteger, nullable=False), Column('year', SmallInteger, nullable=False), Column('quarter', TINYINT, nullable=False), Column('amount', DECIMAL(18, 6), default=None), Column('entry_type', String(50, 'utf8mb4_general_ci'), default=None), comment="Financial close table holds release's accounting data.", ) t_fc_vendor_accounting = Table( 'fc_vendor_accounting', Base.metadata, Column('id', MEDIUMINT, nullable=False), Column('vendor_id', INTEGER, nullable=False), Column('year', SMALLINT, nullable=False), Column('quarter', TINYINT, nullable=False), Column('amount', DECIMAL(18, 6), default=None), Column('entry_type', String(50, 'utf8mb4_general_ci'), default=None), comment="Financial close table holds label/vendor's accounting data.", ) class Features(Base): __tablename__ = 'features' feature_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) feature_name: Mapped[str] = mapped_column(String(45, 'utf8mb4_bin'), nullable=False) is_default: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'1'"), comment='If feature enabled used, 1. Else, 0.', ) ui_restrictions: Mapped[list['UiRestrictions']] = relationship( 'UiRestrictions', back_populates='feature', init=False ) vendor_restricted_features: Mapped[list['VendorRestrictedFeatures']] = relationship( 'VendorRestrictedFeatures', back_populates='feature', init=False ) class FilmGenre(Base): __tablename__ = 'film_genre' film_genre_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) genre: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) film_genre_store_mapping: Mapped[list['FilmGenreStoreMapping']] = relationship( 'FilmGenreStoreMapping', back_populates='film_genre', init=False ) release_film_genre: Mapped[list['ReleaseFilmGenre']] = relationship( 'ReleaseFilmGenre', back_populates='film_genre', init=False ) class FlashlightDelivery(Base, CreateMixin): __tablename__ = 'flashlight_delivery' __table_args__ = ( Index('dms_contact_type', 'dms_contact_type'), Index('type', 'type'), {'comment': 'Marketing table holds history of automated emails sent to DM'}, ) flashlight_delivery_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) dms_contact_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to either customer_master_contact or customer_master_master_contact table.', ) dms_contact_type: Mapped[str] = mapped_column( ENUM('dms', 'dms_master'), nullable=False, comment='This field determines the parent table for the dms_contact.', ) email: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='E-Mail address that received the flashlight.', ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='The date flashlight delivery was sent.', ) type: Mapped[str] = mapped_column( ENUM('automatic', 'manual'), nullable=False, server_default=text("'automatic'"), comment='This field indicates whether the flashlight was generated automatically or manually.', ) local_focus_territory: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='The comma separted country ids indicatating the list of territory used to determine local focus section.', ) delivered_start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='The starting date for the delivery date range used to determine the list of albums in the flashlight.', ) delivered_end_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='The ending date for the delivery date range used to determine the list of albums in the flashlight.', ) created_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table indicates the user who generated the flashlight.', default=None, ) class FlashlightDeliveryDetails(Base): __tablename__ = 'flashlight_delivery_details' __table_args__ = { 'comment': "Marketing table holds details related to emails sent to DMS'" } flashlight_delivery_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) flashlight_delivery_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to flashlight_delivery table.' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='UPC code of the release.' ) section: Mapped[str] = mapped_column( ENUM('top_priorities', 'sec_priorities', 'local_focus', 'also_delivered'), nullable=False, comment="This enumerated field indicates release's section in the flashlight.", ) rank_deprecated: Mapped[int] = mapped_column(SMALLINT, nullable=False) t_full_deletions = Table( 'full_deletions', Base.metadata, Column('upc', BigInteger, comment='Foreign key to releases table.', default=None), Column( 'date_deleted', NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the release is deleted.', default=None, ), Column( 'email_sent', ENUM('Y', 'N'), comment='Yes or No indicates whether email is sent.', default=None, ), Column( 'action', ENUM('delete', 'restore'), server_default=text("'delete'"), comment="Action of the deletion. Value can be 'delete' or 'restore'.", default=None, ), Column( 'orchadmin_user_id', Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who deleted this release.', default=None, ), Column( 'compliance_check_date', NormalizedDate, comment='Date when last compliance check was performed.', default=None, ), Column( 'compliance_check_satisfactory', ENUM('Y', 'N'), server_default=text("'N'"), comment='Flag that indicates if compliance check has been completed to satisfaction', default=None, ), Index('upc', 'upc'), comment='Stores the history of deletion/restoration of releases', ) class Genre(Base): __tablename__ = 'genre' __table_args__ = {'comment': 'Holds release genres'} genre_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) genre: Mapped[str] = mapped_column( String(15, 'utf8mb4_general_ci'), nullable=False, comment='Genre name.' ) subgenre: Mapped[list['Subgenre']] = relationship( 'Subgenre', back_populates='genre', init=False ) rights_attributes_suggestion_genre_subgenre_keywords: Mapped[ list['RightsAttributesSuggestionGenreSubgenreKeywords'] ] = relationship( 'RightsAttributesSuggestionGenreSubgenreKeywords', back_populates='genre', init=False, ) subaccount: Mapped[list['Subaccount']] = relationship( 'Subaccount', back_populates='genre', init=False ) t_grps_not_complete_products = Table( 'grps_not_complete_products', Base.metadata, Column('upc', BigInteger, default=None) ) class HfaStatusCodes(Base): __tablename__ = 'hfa_status_codes' hfa_status_code: Mapped[str] = mapped_column( CHAR(2, 'utf8mb4_bin'), primary_key=True ) definition: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_bin'), default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_bin'), default=None ) resubmit: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) t_hfa_valid_licenses = Table( 'hfa_valid_licenses', Base.metadata, Column('hfa_agreement_code', String(3, 'utf8mb4_general_ci'), default=None), Column('manufacturer_number', String(6, 'utf8mb4_general_ci'), default=None), Column('transaction_date', Integer, default=None), Column('manufacturer_request_number', Integer, default=None), Column('label_name', String(60, 'utf8mb4_general_ci'), default=None), Column('isrc_code', String(15, 'utf8mb4_general_ci'), default=None), Column('playing_time_minutes', Integer, default=None), Column('playing_time_seconds', Integer, default=None), Column('artist', String(200, 'utf8mb4_general_ci'), default=None), Column('song_title', String(200, 'utf8mb4_general_ci'), default=None), Column('aka_song_title', String(200, 'utf8mb4_general_ci'), default=None), Column('iswc_code', String(11, 'utf8mb4_general_ci'), default=None), Column('hfa_song_code', String(6, 'utf8mb4_general_ci'), default=None), Column('composers', String(200, 'utf8mb4_general_ci'), default=None), Column('publisher_name', String(60, 'utf8mb4_general_ci'), default=None), Column('hfa_publisher_number', String(60, 'utf8mb4_general_ci'), default=None), Column('exact_per_publisher_share', Integer, default=None), Column('catalog_number', String(15, 'utf8mb4_general_ci'), default=None), Column('album_title', String(200, 'utf8mb4_general_ci'), default=None), Column('upc_code', String(16, 'utf8mb4_general_ci'), default=None), Column('configuration_codes', String(2, 'utf8mb4_general_ci'), default=None), Column('license_type', String(1, 'utf8mb4_general_ci'), default=None), Column('server_fixation_date', Integer, default=None), Column('rate_code', String(1, 'utf8mb4_general_ci'), default=None), Column('hfa_output_1', DECIMAL(12, 7), default=None), Column('hfa_output_2', DECIMAL(5, 2), default=None), Column('hfa_output_3', DECIMAL(5, 2), default=None), Column('hfa_license_number_direct_deal_reference_id', Integer, default=None), Column('hfa_request_process_code_1', String(2, 'utf8mb4_general_ci'), default=None), Column('hfa_request_process_code_2', String(2, 'utf8mb4_general_ci'), default=None), Column('hfa_request_process_code_3', String(2, 'utf8mb4_general_ci'), default=None), Column('hfa_request_process_code_4', String(2, 'utf8mb4_general_ci'), default=None), Column('licensed_status_code', String(2, 'utf8mb4_general_ci'), default=None), Column('hfa_output_field', String(1, 'utf8mb4_general_ci'), default=None), Column('publisher_status', String(1, 'utf8mb4_general_ci'), default=None), Column('total_hfa_licensed_share', DECIMAL(7, 4), default=None), Column('user_defined_1', String(200, 'utf8mb4_general_ci'), default=None), Column('user_definied_2_track_id', String(200, 'utf8mb4_general_ci'), default=None), Column('user_defined_3', String(200, 'utf8mb4_general_ci'), default=None), Column( 'user_defined_4_distribution_date', String(200, 'utf8mb4_general_ci'), default=None, ), Column('user_defined_5', String(200, 'utf8mb4_general_ci'), default=None), Column('user_defined_6', String(200, 'utf8mb4_general_ci'), default=None), Column('user_defined_7_tr_code', String(2, 'utf8mb4_general_ci'), default=None), Column( 'user_defined_8_priority_code', String(18, 'utf8mb4_general_ci'), default=None ), Column('user_defined_9_pid', String(20, 'utf8mb4_general_ci'), default=None), Column( 'created_date', NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), ), Column('response_filename', String(100, 'utf8mb4_general_ci'), nullable=False), Index('isrc', 'isrc_code'), Index('license_number', 'hfa_license_number_direct_deal_reference_id'), Index('upc', 'upc_code'), ) class ImageCategory(Base): __tablename__ = 'image_category' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) category: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) path: Mapped[str] = mapped_column(String(100, 'utf8mb4_general_ci'), nullable=False) image_assets: Mapped[list['ImageAssets']] = relationship( 'ImageAssets', back_populates='category', init=False ) class ImportAssetBatch(Base): __tablename__ = 'import_asset_batch' __table_args__ = ( Index('FK_upload_request', 'vendor_contact_id'), Index('FK_upload_request_orchadmin_users', 'impersonated'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key', autoincrement=True, init=False ) impersonated: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='foreign key to orchadmin_users table', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) import_type: Mapped[str] = mapped_column( ENUM('upload', 'copy', 'replace'), nullable=False, server_default=text("'upload'"), comment='type of asset import requested', ) vendor_contact_id: Mapped[Optional[int]] = mapped_column( Integer, comment='foreign key to vend_contact table', default=None ) ip_address: Mapped[Optional[int]] = mapped_column( INTEGER, comment='int for IP Address use PHP long2ip() to retrieve', default=None, ) token: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='unique hash for current upload request for processing folder names', default=None, ) import_asset: Mapped[list['ImportAsset']] = relationship( 'ImportAsset', back_populates='import_asset_batch', init=False ) class IndustryGrowth(Base): __tablename__ = 'industry_growth' __table_args__ = ( Index('territory', 'region', 'year', 'pnl_id', unique=True), {'comment': 'deprecated'}, ) industry_growth_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) region: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) year: Mapped[Optional[int]] = mapped_column(Integer, default=None) q1_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) q2_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) q3_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) q4_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) yr_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) pnl_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class Instock(Base): __tablename__ = 'instock' __table_args__ = {'comment': 'Holds physical releases instock'} upc: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'"), comment='Foreign key to releases table.', ) location: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Location information of the release.', default=None, ) qty: Mapped[Optional[int]] = mapped_column( Integer, comment='Quantity information of the CD for this release.', default=None, ) class Instrument(Base): __tablename__ = 'instrument' __table_args__ = {'comment': 'Stores a list of instruments for releases'} instrument_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) instrument: Mapped[str] = mapped_column( String(35, 'utf8mb4_general_ci'), nullable=False, comment='Instrument name.' ) class IntMktPriority(Base): __tablename__ = 'int_mkt_priority' __table_args__ = ( Index('release_id', 'release_id'), Index('type_id', 'country_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) priority: Mapped[int] = mapped_column( Integer, nullable=False, comment='Integrated Marketing Priority' ) country_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to country table.', ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) release_id: Mapped[Optional[int]] = mapped_column( INTEGER, server_default=text("'0'"), default=None ) class InventoryReturnDelete(Base): __tablename__ = 'inventory_return_delete' __table_args__ = { 'comment': 'For returning instock releases to labels. The content will ' } inventory_return_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) handle: Mapped[Optional[str]] = mapped_column( ENUM('destroy_the_stock', 'return_to_address'), default=None ) address_name: Mapped[Optional[str]] = mapped_column( CHAR(255, 'utf8mb4_general_ci'), default=None ) address_1: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) address_2: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) city: Mapped[Optional[str]] = mapped_column( CHAR(255, 'utf8mb4_general_ci'), default=None ) orchard_state_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) zip: Mapped[Optional[int]] = mapped_column(Integer, default=None) update_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) orchard_country: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) label_name: Mapped[Optional[str]] = mapped_column( CHAR(255, 'utf8mb4_general_ci'), default=None ) class IodaCleanupAssets(Base, UpdateMixin): __tablename__ = 'ioda_cleanup_assets' __table_args__ = (Index('IDX_upc', 'upc'),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) ioda_release_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) process_flag: Mapped[Optional[str]] = mapped_column( ENUM('y', 'n', 'error', 'assets_exist', 'dulpicate'), server_default=text("'n'"), default=None, ) rename_flag: Mapped[Optional[str]] = mapped_column( ENUM('y', 'n', 'error', 'not_required'), server_default=text("'n'"), default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) result: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) ioda_cleanup_import_assets: Mapped[list['IodaCleanupImportAssets']] = relationship( 'IodaCleanupImportAssets', back_populates='ioda_cleanup_asset', init=False ) class IodaClientManagerMapping(Base, CreateMixin): __tablename__ = 'ioda_client_manager_mapping' ioda_content_manager_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_first_name: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) orchard_orchadmin_user_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) orchard_first_name: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) ioda_last_name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) orchard_last_name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) create_date: Mapped[Optional[datetime.time]] = mapped_column(Time, default=None) created_by: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), server_default=text("'Michael Luckenbill'"), default=None, ) class IodaContactMapping(Base, CreateMixin): __tablename__ = 'ioda_contact_mapping' __table_args__ = (Index('ioda_person_id', 'ioda_person_id', 'orchard_contact_id'),) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) ioda_person_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_contact_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaDeliveryHistoryMappingFix(Base): __tablename__ = 'ioda_delivery_history_mapping_fix' delivery_history_mapping_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) ioda_export_release_status_log_id: Mapped[int] = mapped_column( BigInteger, nullable=False ) ioda_upc: Mapped[int] = mapped_column(BigInteger, nullable=False) orchard_customer_master_master_id: Mapped[int] = mapped_column( Integer, nullable=False ) ioda_date_delivered: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) orchard_customer_id: Mapped[int] = mapped_column(Integer, nullable=False) ioda_codecs: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), default=None ) class IodaItunesReleaseMapping(Base, CreateMixin): __tablename__ = 'ioda_itunes_release_mapping' __table_args__ = ( Index( 'orchard_release_id', 'orchard_release_id', 'store_service_id', 'ioda_release_id', 'ioda_release_service_client_id', ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) apple_vendor_id: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'") ) orchard_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) store_service_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_store_release_identifier: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), default=None ) ioda_asset_upc: Mapped[Optional[str]] = mapped_column( String(13, 'utf8mb4_general_ci'), default=None ) ioda_release_service_client_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaItunesStaging(Base, CreateMixin): __tablename__ = 'ioda_itunes_staging' __table_args__ = ( Index( 'orchard_release_id', 'orchard_release_id', 'store_service_id', 'ioda_release_id', 'ioda_release_service_client_id', ), ) ioda_itunes_staging_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) orchard_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) store_service_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_store_release_identifier: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), default=None ) ioda_asset_upc: Mapped[Optional[str]] = mapped_column( String(13, 'utf8mb4_general_ci'), default=None ) ioda_release_service_client_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaLabelMapping(Base): __tablename__ = 'ioda_label_mapping' __table_args__ = ( Index( 'ioda_rightsholder_id', 'ioda_rightsholder_id', 'ioda_label_id', 'orchard_subaccount_id', ), ) ioda_rightsholder_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_label_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) orchard_subaccount_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) label_name: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) label_type: Mapped[Optional[str]] = mapped_column( ENUM('imprint', 'subaccount'), default=None ) class IodaPrimaryReleaseArtistBioFix(Base): __tablename__ = 'ioda_primary_release_artist_bio_fix' artist_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) rightsholder_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) bio_text: Mapped[Optional[str]] = mapped_column(MEDIUMTEXT, default=None) class IodaPrimaryReleaseArtistFix(Base): __tablename__ = 'ioda_primary_release_artist_fix' ioda_primary_artist_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'") ) ioda_rightsholder_id: Mapped[int] = mapped_column(Integer, primary_key=True) ioda_artist_name: Mapped[Optional[str]] = mapped_column( String(191, 'utf8mb4_general_ci'), default=None ) ioda_city: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), default=None ) ioda_bio_text: Mapped[Optional[str]] = mapped_column( String(0, 'utf8mb4_general_ci'), default=None ) class IodaPrimaryReleaseArtistNameFix(Base): __tablename__ = 'ioda_primary_release_artist_name_fix' ioda_primary_artist_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'") ) ioda_artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaReleaseArtistMapping(Base, CreateMixin, UpdateMixin): __tablename__ = 'ioda_release_artist_mapping' __table_args__ = ( Index( 'ioda_release_artist_id', 'ioda_release_artist_id', 'orchard_release_artist_id', ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) ioda_release_artist_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_release_artist_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_modified_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaReleaseExclusiveCarveouts(Base): __tablename__ = 'ioda_release_exclusive_carveouts' ioda_release_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_service_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_service_publish_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) class IodaReleaseMapping(Base, CreateMixin): __tablename__ = 'ioda_release_mapping' __table_args__ = ( Index('idx_orchard_upc', 'orchard_upc', unique=True), Index('ioda_release_id', 'ioda_release_id'), Index('migration_type', 'migration_type'), Index('orchard_release_id', 'orchard_release_id'), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) orchard_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) orchard_upc_text: Mapped[Optional[str]] = mapped_column(VARCHAR(13), default=None) ioda_upc: Mapped[Optional[str]] = mapped_column(VARCHAR(13), default=None) ioda_display_artist: Mapped[Optional[str]] = mapped_column( VARCHAR(255), default=None ) ioda_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_release_name: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) ioda_vendor_release_id: Mapped[Optional[str]] = mapped_column( VARCHAR(32), default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column(VARCHAR(128), default=None) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) orchard_release_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) orchard_artist_info_artist_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) ioda_primary_artist_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) migration_type: Mapped[Optional[str]] = mapped_column( ENUM('primary', 'shared', 'duplicate'), default=None ) ioda_track_count: Mapped[Optional[int]] = mapped_column(Integer, default=None) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaReleaseMigrationStopList(Base): __tablename__ = 'ioda_release_migration_stop_list' ioda_release_id: Mapped[int] = mapped_column(Integer, primary_key=True) reason: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) class IodaReleasePrimaryArtistMapping(Base, CreateMixin, UpdateMixin): __tablename__ = 'ioda_release_primary_artist_mapping' __table_args__ = ( Index( 'ioda_primary_artist_id', 'ioda_primary_artist_id', 'ioda_rightsholder_id', 'orchard_artist_id', ), ) ioda_primary_artist_id: Mapped[int] = mapped_column(BigInteger, primary_key=True) ioda_rightsholder_id: Mapped[int] = mapped_column(Integer, primary_key=True) orchard_artist_id: Mapped[int] = mapped_column(BigInteger, primary_key=True) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_modified_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaReleaseRightsholder(Base): __tablename__ = 'ioda_release_rightsholder' release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'") ) rightsholder_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, server_default=text("'0'") ) rga: Mapped[str] = mapped_column( SET( 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BM', 'BN', 'BO', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', ), nullable=False, server_default=text("''"), ) rgb: Mapped[str] = mapped_column( SET( 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', ), nullable=False, server_default=text("''"), ) rgc: Mapped[str] = mapped_column( SET( 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', ), nullable=False, server_default=text("''"), ) rgd: Mapped[str] = mapped_column( SET( 'QA', 'RE', 'RO', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'ST', 'SV', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW', ), nullable=False, server_default=text("''"), ) label_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) owner: Mapped[Optional[str]] = mapped_column( ENUM('Y'), comment='this rightsholder and label own the metadata assets for the release', default=None, ) dateadded: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) addedby: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_bin'), default=None ) dateupdated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updatedby: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_bin'), default=None ) class IodaReleases(Base): __tablename__ = 'ioda_releases' __table_args__ = (Index('index2', 'upc'),) release_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) upc: Mapped[Optional[str]] = mapped_column(VARCHAR(13), default=None) class IodaRightsholderMapping(Base, CreateMixin): __tablename__ = 'ioda_rightsholder_mapping' __table_args__ = ( Index('ioda_rightsholder_id', 'ioda_rightsholder_id', 'orchard_vendor_id'), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) pre_migrated: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) ioda_rightsholder_id: Mapped[Optional[int]] = mapped_column( SmallInteger, default=None ) orchard_vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) modified_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) modified_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaRightsholderMigrationStopList(Base): __tablename__ = 'ioda_rightsholder_migration_stop_list' ioda_rightsholder_id: Mapped[int] = mapped_column(Integer, primary_key=True) ioda_rightsholder_name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) note: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class IodaRightsholderServiceCarveouts(Base): __tablename__ = 'ioda_rightsholder_service_carveouts' ioda_rightsholder_id: Mapped[int] = mapped_column(Integer, primary_key=True) ioda_service_id: Mapped[int] = mapped_column(Integer, nullable=False) orchard_customer_master_master_id: Mapped[int] = mapped_column( Integer, primary_key=True ) orchard_vendor_id: Mapped[int] = mapped_column(Integer, primary_key=True) class IodaRightsholderSubserviceCarveouts(Base): __tablename__ = 'ioda_rightsholder_subservice_carveouts' ioda_rightsholder_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_service_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_iso_alpha2: Mapped[str] = mapped_column( String(2, 'utf8mb4_bin'), primary_key=True ) orchard_customer_master_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) orchard_vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class IodaRightsholderTerritoryCarveouts(Base): __tablename__ = 'ioda_rightsholder_territory_carveouts' ioda_rightsholder_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) orchard_vendor_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) orchard_country_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_iso_alpha2: Mapped[Optional[str]] = mapped_column( String(2, 'utf8mb4_general_ci'), default=None ) class IodaServiceMapping(Base, CreateMixin): __tablename__ = 'ioda_service_mapping' __table_args__ = ( Index( 'orchard_delivery_history_customer_master_master_id', 'orchard_delivery_history_customer_master_master_id', 'orchard_carveout_customer_master_master_id', 'ioda_service_id', ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) orchard_migiration_type: Mapped[str] = mapped_column( ENUM('overlap', 'ioda only', 'not known'), nullable=False ) create_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) orchard_delivery_history_customer_master_master_id: Mapped[Optional[int]] = ( mapped_column(Integer, default=None) ) orchard_delivery_history_customer_master_master_name: Mapped[Optional[str]] = ( mapped_column(String(255, 'utf8mb4_general_ci'), default=None) ) orchard_carveout_customer_master_master_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) orchard_carveout_customer_master_master_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) ioda_service_id: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) ioda_service_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) ioda_service_classification: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), default=None ) updated_by: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaServiceReleaseMapping(Base, CreateMixin): __tablename__ = 'ioda_service_release_mapping' ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) store_service_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_release_id_format: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) ioda_track_id_format: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class IodaSharedReleaseRemap(Base): __tablename__ = 'ioda_shared_release_remap' ioda_release_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_rightsholder_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) ioda_label_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class IodaStartingEndingBalanceExchangeRate(Base): __tablename__ = 'ioda_starting_ending_balance_exchange_rate' __table_args__ = (Index('ioda_currency_code', 'ioda_currency_code'),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) orchard_exchange_rate: Mapped[float] = mapped_column(Float, nullable=False) ioda_currency_code: Mapped[Optional[str]] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), default=None ) class IodaTrackArtistMapping(Base, CreateMixin, UpdateMixin): __tablename__ = 'ioda_track_artist_mapping' ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) ioda_track_artist_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_track_artist_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_modified_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaTrackMapping(Base, CreateMixin): __tablename__ = 'ioda_track_mapping' __table_args__ = ( Index('ioda_release', 'ioda_release_id'), Index('ioda_track', 'ioda_track_id'), Index('orch_track', 'orchard_track_id'), Index( 'orchard_track_id', 'orchard_track_id', 'ioda_track_id', 'ioda_release_id' ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) orchard_track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_isrc: Mapped[Optional[str]] = mapped_column(VARCHAR(16), default=None) ioda_release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_track_name: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) ioda_version_info: Mapped[Optional[str]] = mapped_column(VARCHAR(128), default=None) ioda_vendor_track_id: Mapped[Optional[str]] = mapped_column( VARCHAR(32), default=None ) ioda_display_artist_name: Mapped[Optional[str]] = mapped_column( VARCHAR(255), default=None ) ioda_disc_number: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) ioda_track_sequence: Mapped[Optional[int]] = mapped_column( SmallInteger, default=None ) ioda_sound_recording_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) orchard_isrc: Mapped[Optional[str]] = mapped_column(VARCHAR(16), default=None) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column(VARCHAR(128), default=None) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaTrackPublisherMapping(Base, CreateMixin, UpdateMixin): __tablename__ = 'ioda_track_publisher_mapping' __table_args__ = ( Index( 'ioda_track_id', 'ioda_track_id', 'ioda_publisher_id', 'ioda_work_territory_id', 'orchard_track_id', 'orchard_track_publisher_id', ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) ioda_track_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) ioda_publisher_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) ioda_work_territory_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) ioda_sharepercent: Mapped[Optional[float]] = mapped_column(Float, default=None) orchard_track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_track_publisher_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_modified_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) class IodaTrackWriterMapping(Base, CreateMixin, UpdateMixin): __tablename__ = 'ioda_track_writer_mapping' __table_args__ = ( Index( 'ioda_track_id', 'ioda_track_id', 'ioda_writer_id', 'ioda_work_territory_id', 'orchard_track_id', 'orchard_track_writer_id', ), ) ID: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) ioda_track_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) ioda_writer_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) ioda_work_territory_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) orchard_track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_track_writer_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) create_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) last_modified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) last_modified_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) t_ioda_tv_mapping = Table( 'ioda_tv_mapping', Base.metadata, Column('ioda_video_id', Integer, default=None), Column('apple_season_id', BigInteger, default=None), Column('apple_episode_id', BigInteger, default=None), Column('orchard_upc', String(15, 'utf8mb4_general_ci'), default=None), Column('video_type', String(10, 'utf8mb4_general_ci'), default=None), Column('artist_status', String(10, 'utf8mb4_general_ci'), default=None), Column('container_id', String(300, 'utf8mb4_general_ci'), default=None), ) class IodaVendContactMapping(Base, CreateMixin): __tablename__ = 'ioda_vend_contact_mapping' __table_args__ = ( Index( 'ioda_rightsholder_id', 'ioda_rightsholder_id', 'ioda_label_id', 'ioda_person_id', 'orchard_vend_contact_id', ), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) ioda_rightsholder_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) ioda_label_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) ioda_person_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) orchard_vend_contact_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), default=None ) class IodaVendorContractMapping(Base, CreateMixin): __tablename__ = 'ioda_vendor_contract_mapping' __table_args__ = ( Index( 'ioda_righthsolder_contract_id', 'ioda_righthsolder_contract_id', 'orchard_vendor_contract_id', ), ) ID: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) ioda_righthsolder_contract_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) orchard_vendor_contract_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) class IodaVideoMapping(Base): __tablename__ = 'ioda_video_mapping' __table_args__ = (Index('orchard_upc', 'orchard_upc'),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) orchard_upc: Mapped[int] = mapped_column(BigInteger, nullable=False) video_type: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False ) artist_status: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) ioda_video_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) apple_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) isrc: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) class IpLookup(Base): __tablename__ = 'ip_lookup' id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) local_ip: Mapped[str] = mapped_column( String(15, 'utf8mb4_general_ci'), nullable=False ) name: Mapped[str] = mapped_column(String(15, 'utf8mb4_general_ci'), nullable=False) active_user: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) function_deprecated: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) manager_scripts: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) physical_location_id: Mapped[int] = mapped_column(TINYINT, nullable=False) active: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) remote_ip: Mapped[Optional[str]] = mapped_column( String(15, 'utf8mb4_general_ci'), default=None ) max_function_jobs: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) class Isrcs(Base): __tablename__ = 'isrcs' __table_args__ = ( Index('idx_status_isrc_year', 'status', 'isrc'), Index('status', 'status'), ) isrc: Mapped[str] = mapped_column( String(12, 'utf8mb4_general_ci'), primary_key=True ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) status: Mapped[Optional[str]] = mapped_column( ENUM('used', 'unused', 'reserved', 'do not use'), server_default=text("'unused'"), default=None, ) class ItunesFilmLanguages(Base): __tablename__ = 'itunes_film_languages' language_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) language: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language_code: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) class ItunesLanguages(Base): __tablename__ = 'itunes_languages' language_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) language: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language_code: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) release_localized_metadata: Mapped[list['ReleaseLocalizedMetadata']] = relationship( 'ReleaseLocalizedMetadata', back_populates='language', init=False ) release_phonetic_translations: Mapped[list['ReleasePhoneticTranslations']] = ( relationship( 'ReleasePhoneticTranslations', back_populates='language', init=False ) ) release_artist_localized_metadata: Mapped[ list['ReleaseArtistLocalizedMetadata'] ] = relationship( 'ReleaseArtistLocalizedMetadata', back_populates='language', init=False ) track_localized_metadata: Mapped[list['TrackLocalizedMetadata']] = relationship( 'TrackLocalizedMetadata', back_populates='language', init=False ) track_artist_localized_metadata: Mapped[list['TrackArtistLocalizedMetadata']] = ( relationship( 'TrackArtistLocalizedMetadata', back_populates='language', init=False ) ) t_join_comments = Table( 'join_comments', Base.metadata, Column('join_id', Integer, default=None), Column('release_id', Integer, default=None), Column('comments', Text(collation='utf8mb4_general_ci'), default=None), Column('calltype', String(50, 'utf8mb4_general_ci'), default=None), Column('active', ENUM('Y', 'N'), default=None), Column('followup_email', String(50, 'utf8mb4_general_ci'), default=None), Column('followup_date', NormalizedDateTime, default=None), Column('followup_sent', ENUM('Y', 'N'), nullable=False, server_default=text("'N'")), Column('user_id', String(20, 'utf8mb4_general_ci'), default=None), Column( 'comments_date', NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ), Index('join_id', 'join_id'), comment='deprecated', ) class LabelSalesAdjustment(Base): __tablename__ = 'label_sales_adjustment' __table_args__ = ( Index('pnl_id', 'pnl_id'), Index('vendor_id', 'vendor_id'), {'comment': 'deprecated'}, ) label_sales_adjustment_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) dms_list: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) num_tracks: Mapped[Optional[int]] = mapped_column(Integer, default=None) street_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) num_releases: Mapped[Optional[int]] = mapped_column(Integer, default=None) pnl_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) new_or_catalog: Mapped[Optional[str]] = mapped_column( ENUM('new', 'catalog'), server_default=text("'new'"), default=None ) class Language(Base): __tablename__ = 'language' __table_args__ = ( Index('idx_apple_compatible', 'apple_compatible'), {'comment': 'Holds all languages, including 2 and 3 characters language c'}, ) language_code: Mapped[str] = mapped_column( String(8, 'utf8mb4_general_ci'), primary_key=True, server_default=text("''") ) language: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Name of the language.', ) apple_compatible: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'1'") ) iso_639_1_code: Mapped[Optional[str]] = mapped_column( String(2, 'utf8mb4_general_ci'), default=None ) iso_code_639_3_code: Mapped[Optional[str]] = mapped_column( String(3, 'utf8mb4_general_ci'), default=None ) customer_master_master: Mapped[list['CustomerMasterMaster']] = relationship( 'CustomerMasterMaster', secondary='dms_preferred_meta_language', back_populates='language', init=False, ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='language', init=False ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='subtitle_language', init=False ) class ListeningNotesRelease(Base, CreateMixin): __tablename__ = 'listening_notes_release' __table_args__ = ( Index('upc', 'upc', unique=True), {'comment': 'Holds release level listening notes'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) scope: Mapped[str] = mapped_column( ENUM('public', 'internal_only', 'waiting_for_approval'), nullable=False, server_default=text("'public'"), ) release_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) created_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) class ListeningNotesTrack(Base): __tablename__ = 'listening_notes_track' __table_args__ = ( Index('upc', 'upc', 'cd', 'track_id', unique=True), {'comment': 'Holds track level listening notes'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) cd: Mapped[int] = mapped_column(TINYINT, nullable=False) track_notes: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) scope: Mapped[str] = mapped_column( ENUM('public', 'internal', 'waiting_for_approval'), nullable=False, server_default=text("'public'"), ) track_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class LoginStat(Base): __tablename__ = 'login_stat' __table_args__ = ( Index('user_id', 'user_id'), {'comment': 'Hold login information of orchadmin users and label'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) user_type: Mapped[str] = mapped_column( ENUM('orchadmin', 'client_area_member', 'client_area_guest', 'vend_contact'), nullable=False, server_default=text("'orchadmin'"), comment='Type of user logging in or impersonating.', ) login_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the user last logged in.', ) ip: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='IP address of the user.', ) impersonated: Mapped[Optional[int]] = mapped_column( Integer, comment='The vend_contact.id being impersonated', default=None ) class ManualAdjustmentCategory(Base): __tablename__ = 'manual_adjustment_category' __table_args__ = {'comment': 'Holds different categories of manual adjustments.'} category_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) category: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) manual_adjustment: Mapped[list['ManualAdjustment']] = relationship( 'ManualAdjustment', back_populates='category_', init=False ) release_manual_adjustment: Mapped[list['ReleaseManualAdjustment']] = relationship( 'ReleaseManualAdjustment', back_populates='category', init=False ) class MarketplaceTermsConditions(Base): __tablename__ = 'marketplace_terms_conditions' terms_and_conditions_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) published_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) version: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(3, 1), default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) marketplace_terms_and_conditions_history: Mapped[ list['MarketplaceTermsAndConditionsHistory'] ] = relationship( 'MarketplaceTermsAndConditionsHistory', back_populates='terms_and_conditions', init=False, ) class MassMailerLog(Base): __tablename__ = 'mass_mailer_log' __table_args__ = {'comment': 'Stores logs for mass mailer'} mass_mail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users. Stores the ID of the orchadmin user who created this mass email.', default=None, ) date_sent: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the mass email is sent.', default=None ) from_email: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='From email address of the mass email.', default=None, ) from_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), server_default=text("''"), default=None ) reply_to: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Reply-to email address of the mass email.', default=None, ) to_email: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='To email address of the mass email.', default=None, ) subject: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Subject of the mass email.', default=None, ) message: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Body message of the mass email.', default=None ) attachment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) campaign: Mapped[Optional[str]] = mapped_column( ENUM('Marketing', 'Newsletter', 'Royalty Letter', 'Other'), default=None ) massmailer_app_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class MasterPitch(Base): __tablename__ = 'master_pitch' __table_args__ = {'comment': 'deprecated'} master_pitch_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) pitch_title: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) pitch_theme: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchadmin_user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) pitch_level: Mapped[Optional[str]] = mapped_column( ENUM('release', 'track'), server_default=text("'release'"), default=None ) dummy_pitch: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) class MasterPitchDetail(Base): __tablename__ = 'master_pitch_detail' __table_args__ = {'comment': 'deprecated'} master_pitch_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) master_pitch_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) product_id: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), default=None ) class MessageTag(Base): __tablename__ = 'message_tag' __table_args__ = ( Index('message_id', 'message_id', 'tag_id', unique=True), Index('tag_id', 'tag_id'), {'comment': 'Links tag and message table.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Auto increment primary key.', autoincrement=True, init=False, ) message_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to message.' ) tag_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to tag.' ) class MetaUpdateDmsMaster(Base): __tablename__ = 'meta_update_dms_master' __table_args__ = ( Index( 'customer_master_master_id', 'customer_master_master_id', 'date_processed' ), Index('date_processed', 'date_processed'), Index('meta_update_queue_id', 'meta_update_queue_id'), {'comment': 'Stores the service where we send the metadata update to and '}, ) meta_update_dms_master_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) meta_update_queue_id: Mapped[int] = mapped_column(INTEGER, nullable=False) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) date_processed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class MetaUpdateQueue(Base): __tablename__ = 'meta_update_queue' __table_args__ = ( Index('date_added', 'date_added'), Index('orchadmin_user_id', 'orchadmin_user_id'), Index('upc', 'upc'), Index('update_type', 'update_type'), {'comment': 'Stores the metadata update information for a particular rele'}, ) meta_update_queue_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) orchadmin_user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) update_type: Mapped[Optional[str]] = mapped_column( ENUM('update', 'deletions', 'track_deletions'), default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) status: Mapped[Optional[str]] = mapped_column( ENUM('completed', 'new', 'processing'), server_default=text("'new'"), default=None, ) class MfitStudio(Base): __tablename__ = 'mfit_studio' __table_args__ = (Index('studio_approved_email_index', 'studio_approved_email'),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) studio_name: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Mastering studio name', ) studio_approved_email: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Studio approved email', ) created_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Initial insert date', ) updated_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Last update date', ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) updated_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='This is orchadmin_user_id of orchadmin_users table who updated mfit data.', default=None, ) release_mfit_info: Mapped[list['ReleaseMfitInfo']] = relationship( 'ReleaseMfitInfo', back_populates='mfit_studio', init=False ) class MktProgram(Base): __tablename__ = 'mkt_program' __table_args__ = {'comment': 'Holds type of marketing program information'} mkt_program_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) program_name: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False, comment='Marketing program name.', ) class MktProgramInfo(Base): __tablename__ = 'mkt_program_info' __table_args__ = ( Index('info_for', 'info_for'), Index('info_for_id', 'info_for_id'), Index('mkt_program_id', 'mkt_program_id'), {'comment': 'Holds marketing program information of track, release, artis'}, ) mkt_program_info_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) mkt_program_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to mkt_program table.', ) info_for_id: Mapped[int] = mapped_column( BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to vendor, aritst_info or releaese table depending on what info_for is.', ) attachment: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment="Yes or No indicates whether there's an attachment.", ) info_for: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'artist', 'release', 'track', 'ex_a_release', 'project'), default=None, ) subject: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Subject of the marketing program info.', default=None, ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text for this marketing program info.', default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date this marketing program info is added.', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date this entry is last updated.', default=None ) scope: Mapped[Optional[str]] = mapped_column( ENUM('public', 'internal_only'), server_default=text("'public'"), comment='This flag indicates whether the marketing program info should be displayed publicly or is meant for internal use only.', default=None, ) client: Mapped[Optional[str]] = mapped_column( ENUM('alw', 'oa'), server_default=text("'oa'"), comment='Describes whether records added/updated from oa or alw', default=None, ) class MktReleaseCredit(Base): __tablename__ = 'mkt_release_credit' __table_args__ = ( Index('upc', 'upc'), {'comment': 'Marketing table holds credit information related to releases'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) upc: Mapped[Optional[int]] = mapped_column(BigInteger, comment='UPC', default=None) name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Artist Name', default=None ) role: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Artist Role', default=None ) release_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to ex_a_release table', default=None ) class MmPackage(Base): __tablename__ = 'mm_package' __table_args__ = {'comment': 'Marketing table holds lists of packages sent to DMS.'} package_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) date_shipped: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date the mm package is shipped.' ) orchadmin_user_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who added this mm package.', ) package_type: Mapped[str] = mapped_column( ENUM('full_album', 'sampler'), nullable=False, server_default=text("'full_album'"), comment='Type of package.', ) package_description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Descriptive text of the package.', default=None, ) date_added: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the package is added.', default=None ) class MmPackageDetail(Base): __tablename__ = 'mm_package_detail' __table_args__ = { 'comment': 'Marketing table holds details regarding packages sent to DMS' } package_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) package_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to mm_package table.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) metadata_sent: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the metadata for the release has been sent.', default=None, ) qty: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'1'"), comment='Quantity of the release in the package.', default=None, ) class Mood(Base): __tablename__ = 'mood' __table_args__ = {'comment': 'Stores list of moods for releases'} mood_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) mood: Mapped[str] = mapped_column( String(35, 'utf8mb4_general_ci'), nullable=False, comment='Name of the mood' ) class Musician(Base): __tablename__ = 'musician' __table_args__ = ( Index('NewIndex1', 'upc'), {'comment': 'Holds list of musicians related to release.'}, ) musician_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Name of the musician.', default=None ) instrument: Mapped[Optional[str]] = mapped_column( String(70, 'utf8mb4_general_ci'), comment='Instrument the musician uses.', default=None, ) email: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Email address of the musician.', default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the musician is added.', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date this entry is last updated.', default=None, ) class NarmAvailability(Base): __tablename__ = 'narm_availability' __table_args__ = { 'comment': "Holds information regarding album's availability on NARM" } upc: Mapped[int] = mapped_column( BigInteger, primary_key=True, server_default=text("'0'"), comment='Foreign key to releases table.', ) availability: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the release is available.', default=None, ) class NewMusicDelete(Base): __tablename__ = 'new_music_delete' __table_args__ = {'comment': 'DEPRECATED'} join_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) contactfname: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contactlname: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) artistname: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) email: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) phone: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), default=None ) manufacturer: Mapped[Optional[str]] = mapped_column( String(140, 'utf8mb4_general_ci'), default=None ) reference: Mapped[Optional[str]] = mapped_column( String(180, 'utf8mb4_general_ci'), default=None ) totalalbums: Mapped[Optional[int]] = mapped_column(Integer, default=None) url: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) genre: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) email_subscribe: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) label: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) login: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), default=None ) password: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) company: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) class Newsletter(Base): __tablename__ = 'newsletter' campainid: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) campaignname: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, server_default=text("''") ) email_subject: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, server_default=text("''") ) startdate: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'") ) territoryid: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) status: Mapped[str] = mapped_column( CHAR(1, 'utf8mb4_general_ci'), nullable=False, server_default=text("'s'") ) senddate: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'") ) createddate: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'") ) createdby: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) typeid: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) class Note(Base): __tablename__ = 'note' __table_args__ = {'comment': 'Stores comments/notes for many sections'} note_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) note_text: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Content of the note.', default=None, ) note_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the note is added.', default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this note.', default=None, ) class Notifications(Base): __tablename__ = 'notifications' notification_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) notification_type_id: Mapped[int] = mapped_column(Integer, nullable=False) recipients: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) parameters: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) sent_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) status: Mapped[Optional[str]] = mapped_column( ENUM('in_queue', 'processed', 'error'), comment='Status of Email Notifications', default=None, ) status_description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of any error in Email Notification', default=None, ) class OaDocuments(Base): __tablename__ = 'oa_documents' __table_args__ = { 'comment': 'Holds all document information uploaded to the OA marketing ' } document_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary Key', autoincrement=True, init=False, ) date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date at which the Document was last uploaded', ) category: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='OA Document Category', default=None ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='OA Document Name', default=None ) location: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='OA Document URL on server', default=None, ) type: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='OA Document Type on server', default=None, ) class OmpRequest(Base): __tablename__ = 'omp_request' __table_args__ = {'comment': 'DEPRECATED'} id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) request_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date of this OMP request.', default=None ) referral: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Referral information of this OMP request.', default=None, ) f_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='First name.', default=None ) l_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Last name.', default=None ) company: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Company name.', default=None ) address_1: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Street address.', default=None ) address_2: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Street address line 2.', default=None ) city: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='City name.', default=None ) state: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchard_state table.', default=None ) other_state: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='State name if not found in orchard state list.', default=None, ) zip: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Zip/postal code.', default=None ) country: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table.', default=None ) phone: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Phone number.', default=None ) fax: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Fax number.', default=None ) email: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Email address.', default=None ) production_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the production.', default=None, ) episode_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the episode.', default=None ) clearance_needed_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the clearance needed.', default=None ) composition: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Composition information.', default=None, ) composer: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Composer name.', default=None ) publisher: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Publisher information.', default=None, ) usage_description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of the usage.', default=None, ) usage_qty: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), comment='Quantity of the usage.', default=None ) approx_timing: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Approximate timing.', default=None ) credit_usage: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Credit of the usage.', default=None ) usage_type: Mapped[Optional[str]] = mapped_column( ENUM('background_score', 'feature_camera', 'camera_background'), comment='Type of usage.', default=None, ) song_performed: Mapped[Optional[str]] = mapped_column( ENUM('vocal', 'instrument_only'), comment="How the song is performed. Value can be 'vocal' or 'instrument_only'.", default=None, ) comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comment text if any.', default=None, ) master_use: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Yes or No indicates whether it's for master use.", default=None, ) sync_use: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Yes or No indicates whether it's for sync use.", default=None, ) artist_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Name of the artist.', default=None ) label: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Label name.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='UPC code.', default=None ) music_budget: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Music budget information.', default=None, ) type_of_media: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Type of media information.', default=None, ) type_of_production: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Type of production information.', default=None, ) class OmsClient(Base): __tablename__ = 'oms_client' __table_args__ = {'comment': 'Holds OMS Client information'} oms_client_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) company: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Company name of the oms client', default=None, ) last_update: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the oms client is last updated', default=None ) owner_REMOVE: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), comment='Owner of the oms client', default=None, ) priority: Mapped[Optional[int]] = mapped_column( Integer, comment='Initial priority number of the oms client. Value can be 1,2,3,or 4', default=None, ) region: Mapped[Optional[int]] = mapped_column( Integer, comment='key to region table', default=None ) primary_genre: Mapped[Optional[int]] = mapped_column( Integer, comment='Primary genre of the oms client. Foreign key to genre table', default=None, ) date_created: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the oms client is created', default=None ) overall_priority: Mapped[Optional[float]] = mapped_column( Float, comment='Overall priority number of the oms client', default=None ) assigned_to: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user whom the oms client is assigned to.', default=None, ) website: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Website URL of the oms client', default=None, ) tax_form_received: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates whether the tax form for the oms client is received', default=None, ) payment_type: Mapped[Optional[str]] = mapped_column( ENUM('check', 'wire'), comment='Payment type', default=None ) wire_info: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='If the OMS client has requested wire payments, this field holds the information required to make a wire payment.', default=None, ) date_signed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date Signed', default=None ) status: Mapped[Optional[str]] = mapped_column( ENUM('pitched', 'pending', 'verbal', 'signed', 'passed', 'inactive'), comment='Status', default=None, ) total_releases: Mapped[Optional[int]] = mapped_column( Integer, comment='Indicates approximate number of releases expected.', default=None, ) total_tracks: Mapped[Optional[int]] = mapped_column( Integer, comment='Indicates approximate number of tracks expected.', default=None, ) owner_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class OmsClientContact(Base): __tablename__ = 'oms_client_contact' __table_args__ = ( Index('oms_client_id', 'oms_client_id'), {'comment': 'Holds contact information of OMS Client'}, ) oms_client_contact_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) oms_client_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) master: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or no indicates whether this is a primary contact for the label.', default=None, ) contact_first_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contact_middle_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contact_last_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contact_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) contact_comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) contact_cell: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) alt_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) checks: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) address_street: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), default=None ) address_city: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), default=None ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) address_state: Mapped[Optional[int]] = mapped_column(Integer, default=None) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) contact_phone_2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) ssn: Mapped[Optional[str]] = mapped_column( String(11, 'utf8mb4_general_ci'), default=None ) address2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) country: Mapped[Optional[int]] = mapped_column(Integer, default=None) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) company: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) instrument: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class OmsClientNotes(Base): __tablename__ = 'oms_client_notes' __table_args__ = ( Index('oms_client_id', 'oms_client_id'), {'comment': "Holds OA users' notes for particular OMS clients"}, ) oms_client_notes_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) oms_client_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) note_text: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) note_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class OmsContact(Base, CreateMixin): __tablename__ = 'oms_contact' __table_args__ = ( Index('country', 'country'), Index('state', 'state'), {'comment': 'Holds OMS contacts'}, ) oms_contact_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) company: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Company of the OMS Contact.', default=None, ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date oms_contact was created.', default=None ) first_name: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment="Contact's first name.", default=None ) last_name: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment="Contact's last name.", default=None ) address_street: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's street address.", default=None, ) address2: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's address line 2.", default=None, ) city: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment="Contact's city.", default=None ) zip: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment="Concact's postal zip code.", default=None, ) state: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key to orchard_state table indicates contact's state.", default=None, ) other_state: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment="Contact's other state if the country is not US", default=None, ) country: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key to country table indicates contact's country.", default=None, ) phone: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment="Contact's phone number.", default=None, ) email: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment="Contact's email address.", default=None, ) checks: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment="Contact's requested checks payable name.", default=None, ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table indicates who created the oms contact.', default=None, ) class OmsLabelDeal(Base): __tablename__ = 'oms_label_deal' __table_args__ = ( Index('oms_label_id', 'label_id'), {'comment': 'Holds lists of potential & active OMS label deals.'}, ) oms_label_deal_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) agreement_status: Mapped[str] = mapped_column( ENUM('pending', 'pending_signature', 'signed'), nullable=False, server_default=text("'pending'"), comment='Status of the agreement.', ) label_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table.', default=None ) label: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Label name.', default=None ) product_manager: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table.', default=None ) contract_legal: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment="Yes or No indicates whether there's a contract with legal.", default=None, ) signed: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Yes or No indicates whether the deal is singed.', default=None, ) exhibit_a: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Yes or No indicates whether it has exhibit a.', default=None, ) source: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who is the source of the deal.', default=None, ) required_action: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment="Action that's required.", default=None, ) content_in_orchadmin: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'Y'"), comment="Yes or No indicates if it's already content in OA.", default=None, ) licensing_status: Mapped[Optional[str]] = mapped_column( ENUM('currently_licensing', 'not_licensing'), server_default=text("'currently_licensing'"), comment='Status of the licensing.', default=None, ) due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the deal is due.', default=None ) class OmsLabelDealOwner(Base): __tablename__ = 'oms_label_deal_owner' __table_args__ = {'comment': 'Holds list of users responsible for the deal.'} oms_label_deal_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to oms_label_deal table.', ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) class OmsProject(Base): __tablename__ = 'oms_project' __table_args__ = {'comment': 'Holds lists of on going and historic OMS projects.'} oms_project_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) project: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='Project name.' ) priority: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Priority number of the project.', default=None ) projected_value: Mapped[Optional[float]] = mapped_column( Float, comment='Project value.', default=None ) request_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the request.', default=None ) due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the project is due.', default=None ) client: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Client information.', default=None ) contact: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Contact information.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of the project.', default=None, ) comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comment text if any.', default=None, ) status: Mapped[Optional[str]] = mapped_column( ENUM('closed', 'contingent_on_use', 'open', 'pending'), server_default=text("'open'"), comment='Status of the project.', default=None, ) associated_tracks: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Tracks that are associated with this project.', default=None, ) submission_comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Submission comment text if any.', default=None, ) contingent_use_value: Mapped[Optional[float]] = mapped_column( Float, comment='Value of contigent use.', default=None ) submission_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the submission.', default=None ) class OmsProjectOwner(Base): __tablename__ = 'oms_project_owner' __table_args__ = {'comment': 'Holds list of users responsible for the OMS project.'} oms_project_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Foreign key to oms_project table.', autoincrement=True, init=False, ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) class OmsTask(Base): __tablename__ = 'oms_task' __table_args__ = ( Index('oms_task_parent_id', 'task_parent_id'), {'comment': 'Contains list of tasks related to Orchard Music services.'}, ) oms_task_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) recurring: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether the task is recurring.', ) status: Mapped[str] = mapped_column( ENUM('ongoing', 'hold', 'completed'), nullable=False, server_default=text("'ongoing'"), comment='Status of the task.', ) task_type: Mapped[str] = mapped_column( ENUM('general', 'label', 'project'), nullable=False, server_default=text("'general'"), comment='Type of the task.', ) priority: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Priority number of the task.', default=None ) task: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Task name.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of the task.', default=None, ) reference_documents: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Reference documents.', default=None, ) date_assigned: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the task is assigned.', default=None ) due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the task is due.', default=None ) task_parent_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Parent ID of the task.', default=None ) comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comment text if any.', default=None, ) class OmsTaskOwner(Base): __tablename__ = 'oms_task_owner' __table_args__ = {'comment': 'Holds OA users responsible for completing the task.'} oms_task_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Foreign key to oms_task table.', autoincrement=True, init=False, ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) class OmsTrack(Base): __tablename__ = 'oms_track' __table_args__ = ( Index('isrc', 'isrc'), Index('upc', 'upc'), {'comment': 'DEPRECATED'}, ) oms_track_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to oms_client or vendor table', default=None ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), comment='The enumerated field indicates the parent entity of oms track.', default=None, ) track_name: Mapped[Optional[str]] = mapped_column( String(140, 'utf8mb4_general_ci'), comment='Name / title of the track.', default=None, ) isrc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='ISRC code of the track.', default=None, ) length_minute: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Track length minute part.', default=None, ) length_seconds: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Track length second part.', default=None, ) explicit_lyrics: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the track hsas explicit lyrics.', default=None, ) release_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The name of the release', default=None, ) artist_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The name of the artist', default=None ) upc: Mapped[Optional[int]] = mapped_column(BigInteger, comment='UPC', default=None) cd: Mapped[Optional[int]] = mapped_column( TINYINT, comment='CD volume number of the track.', default=None ) track_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Track number of the track.', default=None ) writer: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Song writer of the track. ', default=None, ) publisher: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publisher of the track.', default=None, ) third_party_publisher: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='The flag indicates whether or not publishing is controlled by a third party.', default=None, ) p_line: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Phonogram right info of the track.', default=None, ) c_line: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Copyright information of the release. ', default=None, ) mechanical: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='whether track is mechanical or not', default=None, ) royalty_collection: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='whether track is royalty collection or not', default=None, ) publishing_admin: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='whether track is publishing admin or not', default=None, ) sync_admin: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='whether track is sync admin or not', default=None, ) class Onesheet(Base): __tablename__ = 'onesheet' __table_args__ = ( Index('NewIndex1', 'upc'), Index('release_id', 'release_id'), {'comment': 'Holds one sheet '}, ) onesheet_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Album description', default=None ) units_sold: Mapped[Optional[int]] = mapped_column( Integer, comment='Units of previous release sold worldwide from this artist', default=None, ) focus_tracks: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Focus tracks up to 3', default=None ) tour_dates: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Tour dates', default=None ) release_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to ex_a_release table', default=None ) class OnesheetCredit(Base): __tablename__ = 'onesheet_credit' __table_args__ = {'comment': 'Holds credit associates with one sheet'} onesheet_credit_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) onesheet_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to onesheet table', default=None ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Credit name', default=None ) role: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Credit role', default=None ) class OnesheetSellingPoint(Base): __tablename__ = 'onesheet_selling_point' __table_args__ = {'comment': 'Holds selling point associates with one sheet'} selling_point_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) onesheet_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to onesheet table', default=None ) selling_point: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Selling point', default=None ) class OnesheetSellingPointTerritory(Base): __tablename__ = 'onesheet_selling_point_territory' __table_args__ = { 'comment': 'Holds selling point associates with one sheet territorial in' } selling_territory_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) selling_point_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to onesheet_selling_point table', default=None ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table', default=None ) class OptInPreference(Base): __tablename__ = 'opt_in_preference' opt_in_preference_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) preference_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='preference_type + date. E.g ffm_marketing_04092019', default=None, ) vendor_agreement: Mapped[list['VendorAgreement']] = relationship( 'VendorAgreement', back_populates='opt_in_preference', init=False ) class OrchadminPermissionsOld(Base): __tablename__ = 'orchadmin_permissions_old' __table_args__ = {'comment': 'Holds orchadmin user permissions'} orchadmin_permission_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) permission_name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='Permission name.' ) section_name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='Section name.' ) class OrchadminPrivileges(Base): __tablename__ = 'orchadmin_privileges' orchadmin_privilege_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) privilege: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) orchadmin_permissions: Mapped[list['OrchadminPermissions']] = relationship( 'OrchadminPermissions', back_populates='orchadmin_privilege', init=False ) class OrchadminResources(Base): __tablename__ = 'orchadmin_resources' orchadmin_resource_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) resource: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) orchadmin_permissions: Mapped[list['OrchadminPermissions']] = relationship( 'OrchadminPermissions', back_populates='orchadmin_resource', init=False ) class OrchadminRoles(Base): __tablename__ = 'orchadmin_roles' __table_args__ = {'comment': 'Holds orchadmin user roles'} orchadmin_role_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) orchadmin_role: Mapped[str] = mapped_column( VARCHAR(45), nullable=False, comment='Role name.' ) orchadmin_user_roles: Mapped[list['OrchadminUserRoles']] = relationship( 'OrchadminUserRoles', back_populates='orchadmin_role', init=False ) orchadmin_role_permissions: Mapped[list['OrchadminRolePermissions']] = relationship( 'OrchadminRolePermissions', back_populates='orchadmin_role', init=False ) class OrchadminUserPermission(Base): __tablename__ = 'orchadmin_user_permission' __table_args__ = ( Index( 'orchadmin_permission_user', 'orchadmin_permission_id', 'orchadmin_user_id', unique=True, ), {'comment': 'Intermediary table for many to many relationship which links'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) orchadmin_permission_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_permissions table.' ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) class OrchadminUsers(Base, UpdateMixin): __tablename__ = 'orchadmin_users' __table_args__ = ( Index('auth0_user_id', 'auth0_user_id'), Index('login', 'login', unique=True), {'comment': 'Holds user accounts data in OA'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) login: Mapped[str] = mapped_column( String(64, 'utf8mb4_general_ci'), nullable=False, comment='Username of the orchadmin user', ) pass_: Mapped[str] = mapped_column( 'pass', String(50, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), ) f_name: Mapped[str] = mapped_column( String(35, 'utf8mb4_general_ci'), nullable=False, comment='First name of the orchadmin user.', ) l_name: Mapped[str] = mapped_column( String(35, 'utf8mb4_general_ci'), nullable=False, comment='Last name of the orchadmin user.', ) role: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) old_password: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Password of the orchadmin user.', default=None, ) password: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) owner: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Owner information of the user.', default=None, ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the user is active.', default=None, ) office_phone: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Office phone number of the user.', default=None, ) extension: Mapped[Optional[int]] = mapped_column( Integer, comment='Office phone number extension of the user.', default=None ) alt_phone: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Alternative phone number of the user.', default=None, ) email: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), comment='Email address of the user.', default=None, ) last_search: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), comment='Last search the user performed.', default=None, ) password_date_changed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) closer: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) office_location: Mapped[Optional[str]] = mapped_column( String(35, 'utf8mb4_general_ci'), default=None ) title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) department: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) display: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) password_request_key: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='password request key', default=None ) password_reset_datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='datetime password request was made', default=None ) auth0_user_id: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) referring_employee: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='This is to identify who referred (employee referral) the deal showing under contracts.', default=None, ) is_product_manager: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'0'"), comment='This is to identify the Product Manager.', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user that modified the record. Example: oa or alw', default=None, ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Id of user that modified the record. Example: orchadmin_users.id or vend_contact.id.', default=None, ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='orchadmin_users', init=False ) youtube_channel_cms_account_history: Mapped[ list['YoutubeChannelCmsAccountHistory'] ] = relationship( 'YoutubeChannelCmsAccountHistory', back_populates='orchadmin_users', init=False ) blacklist_reasons: Mapped[list['BlacklistReasons']] = relationship( 'BlacklistReasons', back_populates='orchadmin_users', init=False ) master_blacklist: Mapped[list['MasterBlacklist']] = relationship( 'MasterBlacklist', back_populates='orchadmin_users', init=False ) orchadmin_user_owners: Mapped[list['OrchadminUserOwners']] = relationship( 'OrchadminUserOwners', back_populates='orchadmin_user', init=False ) orchadmin_user_roles: Mapped[list['OrchadminUserRoles']] = relationship( 'OrchadminUserRoles', back_populates='orchadmin_user', init=False ) orchadmin_user_saved_query: Mapped[list['OrchadminUserSavedQuery']] = relationship( 'OrchadminUserSavedQuery', back_populates='orchadmin_user', init=False ) youtube_channel_partner_status_history: Mapped[ list['YoutubeChannelPartnerStatusHistory'] ] = relationship( 'YoutubeChannelPartnerStatusHistory', back_populates='orchadmin_users', init=False, ) youtube_channel_service_tier_history: Mapped[ list['YoutubeChannelServiceTierHistory'] ] = relationship( 'YoutubeChannelServiceTierHistory', back_populates='orchadmin_users', init=False ) blacklist_words: Mapped[list['BlacklistWords']] = relationship( 'BlacklistWords', back_populates='orchadmin_users', init=False ) vendor: Mapped[list['Vendor']] = relationship( 'Vendor', foreign_keys='[Vendor.assigned_reviewer]', back_populates='orchadmin_users', init=False, ) vendor_: Mapped[list['Vendor']] = relationship( 'Vendor', foreign_keys='[Vendor.assigned_to]', back_populates='orchadmin_users_', init=False, ) vendor1: Mapped[list['Vendor']] = relationship( 'Vendor', foreign_keys='[Vendor.last_modified_by]', back_populates='orchadmin_users1', init=False, ) vendor2: Mapped[list['Vendor']] = relationship( 'Vendor', foreign_keys='[Vendor.quarterback_label_manager]', back_populates='orchadmin_users2', init=False, ) vendor3: Mapped[list['Vendor']] = relationship( 'Vendor', foreign_keys='[Vendor.wel_email_sender]', back_populates='orchadmin_users3', init=False, ) video_dashboard_item_status: Mapped[list['VideoDashboardItemStatus']] = ( relationship('VideoDashboardItemStatus', back_populates='user', init=False) ) product_manager_mapping_vendor: Mapped[list['ProductManagerMappingVendor']] = ( relationship( 'ProductManagerMappingVendor', back_populates='product_manager', init=False ) ) vendor_closers: Mapped[list['VendorClosers']] = relationship( 'VendorClosers', foreign_keys='[VendorClosers.last_modified_by]', back_populates='orchadmin_users', init=False, ) vendor_closers_: Mapped[list['VendorClosers']] = relationship( 'VendorClosers', foreign_keys='[VendorClosers.orchadmin_user_id]', back_populates='orchadmin_user', init=False, ) youtube_audit: Mapped[list['YoutubeAudit']] = relationship( 'YoutubeAudit', back_populates='initiated_by', init=False ) api_invoices: Mapped[list['ApiInvoices']] = relationship( 'ApiInvoices', back_populates='orchadmin_users', init=False ) artist_services_assigned_release: Mapped[list['ArtistServicesAssignedRelease']] = ( relationship( 'ArtistServicesAssignedRelease', back_populates='orchadmin_users', init=False, ) ) correction: Mapped[list['Correction']] = relationship( 'Correction', back_populates='orchadmin_users', init=False ) product_manager_mapping_product: Mapped[list['ProductManagerMappingProduct']] = ( relationship( 'ProductManagerMappingProduct', back_populates='product_manager', init=False ) ) release_manual_adjustment: Mapped[list['ReleaseManualAdjustment']] = relationship( 'ReleaseManualAdjustment', back_populates='orchadmin_users', init=False ) release_subaccount_change_history: Mapped[ list['ReleaseSubaccountChangeHistory'] ] = relationship( 'ReleaseSubaccountChangeHistory', back_populates='orchadmin_users', init=False ) release_approval_queue: Mapped[list['ReleaseApprovalQueue']] = relationship( 'ReleaseApprovalQueue', foreign_keys='[ReleaseApprovalQueue.approved_by]', back_populates='orchadmin_users', init=False, ) release_approval_queue_: Mapped[list['ReleaseApprovalQueue']] = relationship( 'ReleaseApprovalQueue', foreign_keys='[ReleaseApprovalQueue.checked_out_by]', back_populates='orchadmin_users_', init=False, ) track_crop_info: Mapped[list['TrackCropInfo']] = relationship( 'TrackCropInfo', back_populates='orchard_user', init=False ) class OrchardState(Base): __tablename__ = 'orchard_state' __table_args__ = {'comment': 'Holds state within US'} id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) name: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), comment='State name.', default=None ) abbr: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), comment='Two letter code of the state name.', default=None, ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table.', default=None ) tour_dates: Mapped[list['TourDates']] = relationship( 'TourDates', back_populates='state', init=False ) zipcodes: Mapped[list['Zipcodes']] = relationship( 'Zipcodes', back_populates='state', init=False ) class OrderItems(Base): __tablename__ = 'order_items' __table_args__ = ( Index('customer_order_id', 'customer_order_id'), Index('upc', 'upc'), {'comment': 'Holds details regarding a physical order.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_order_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_order table.', ) upc: Mapped[int] = mapped_column( BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ) qty: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Quantity of the release in the order.', ) sellprice: Mapped[Optional[float]] = mapped_column( Float, comment='Sell price of the release.', default=None ) deletions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates if the release is deleted.', default=None, ) picked: Mapped[Optional[int]] = mapped_column( Integer, comment='Number of items picked.', default=None ) class OrderShipping(Base): __tablename__ = 'order_shipping' __table_args__ = { 'comment': 'Holds shipping information related to the physical order.' } id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_order_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to customer_order table.', default=None ) carrier: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Carrier information of the shipping method for the the order.', default=None, ) tracking_no: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Tracking number of the shipment for the order.', default=None, ) shipping_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the shipment.', default=None ) total: Mapped[Optional[float]] = mapped_column( Float, comment='Total amount of the shipping charge.', default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table.', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date this entry is last updated.', default=None, ) method: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Shipping method information.', default=None, ) class Owner(Base, UpdateMixin): __tablename__ = 'owner' __table_args__ = ( CheckConstraint("(`owner_name` <> _utf8mb3'')", name='non_empty_owner_name'), Index('owner_abbrivation', 'owner_abbrivation', unique=True), {'comment': 'Stores partner information'}, ) owner_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) owner_type: Mapped[str] = mapped_column( ENUM('aggregator', 'drr'), nullable=False, server_default=text("'aggregator'"), comment='Type of owner. Partner or DDR.', ) owner_name: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False ) distribution: Mapped[str] = mapped_column( ENUM('digital', 'phys/digital'), nullable=False, server_default=text("'digital'"), comment='Owner distribution type. Value can be digital or phys/digital. Not used anymore?', ) active_contract: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Not used?' ) owner_abbrivation: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Owner name abbreviation', default=None, ) agreement_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Owner agreement start date.', default=None ) agreement_end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Owner agreement end date.', default=None ) signup_fees_cut_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Percentage of sign-up fee.', default=None ) non_standard_vendor_split: Mapped[Optional[float]] = mapped_column( Float, comment='Not used?', default=None ) dms_keep_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Percentage the DMS keeps. Only used to DDR owner type.', default=None, ) aggregator_owner_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Owner ID. Foreign key to owner table for DDR owner type only.', default=None, ) vendor_payment: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment="Yes or No indicates whether it's label payment.", default=None, ) show_physical: Mapped[Optional[str]] = mapped_column( ENUM('digital', 'phys/digital'), server_default=text("'digital'"), default=None ) minimum_required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) is_sme: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Whether label/subaccount is SME', default=None, ) gras_sender_name: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), default=None ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the owner record.', default=None, ) orchadmin_user_owners: Mapped[list['OrchadminUserOwners']] = relationship( 'OrchadminUserOwners', back_populates='owner', init=False ) class OwnerAccounting(Base): __tablename__ = 'owner_accounting' __table_args__ = ( Index('owner_id', 'owner_id'), Index('unique_constraint', 'period_id', 'entry_type', 'owner_id', unique=True), {'comment': 'Static accounting table holds accounting entries related to '}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreing key to owner table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='The total amount for the line item.', default=None ) entry_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The entry type for line item.', default=None, ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class OwnerAccountingOld(Base): __tablename__ = 'owner_accounting_old' __table_args__ = ( Index('owner_id', 'owner_id'), Index('unique_constraint', 'period_id', 'entry_type', 'owner_id', unique=True), {'comment': 'Static accounting table holds accounting entries related to '}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreing key to owner table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='The total amount for the line item.', default=None ) entry_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The entry type for line item.', default=None, ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class OwnerAccountingR2(Base): __tablename__ = 'owner_accounting_r2' __table_args__ = ( Index('owner_id', 'owner_id'), Index('unique_constraint', 'period_id', 'entry_type', 'owner_id', unique=True), {'comment': 'Static accounting table holds accounting entries related to '}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreing key to owner table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='The total amount for the line item.', default=None ) entry_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The entry type for line item.', default=None, ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class OwnerCheckspaid(Base): __tablename__ = 'owner_checkspaid' __table_args__ = ( Index('owner_id', 'owner_id'), Index('vendor_id', 'vendor_id'), {'comment': 'Accounting table holds payments made to the owner.'}, ) owner_checkspaid_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to owner table.', ) check_no: Mapped[str] = mapped_column( String(16, 'utf8mb4_general_ci'), nullable=False, comment='Check number.' ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) check_payable: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Payee information to whom the check should be paid to.', default=None, ) check_amt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount paid.', default=None ) cut_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the check is cut.', default=None ) cash_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the check is cashed.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) paidfor_type: Mapped[Optional[str]] = mapped_column( ENUM( 'phy_payment', 'dig_payment', 'agg_royalty', 'drr_royalty', 'drr_royalty_advanced', 'advanced_payment', ), comment='Purpose of the check paid for.', default=None, ) advanced_payment_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Percentage of advanced payment.', default=None ) paid_to_vendor: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment="Yes or No indicates whether it's paid to the label.", default=None, ) paidfor_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) t_owner_contact = Table( 'owner_contact', Base.metadata, Column( 'owner_id', INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to owner table.', ), Column( 'contact_id', INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to contact table.', ), Column( 'master', ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment="Yes or No indicates whether it's the master contact.", ), Column( 'user_type', ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ), Column( 'last_modified_by', Integer, server_default=text("'179'"), comment='user_id who modified the owner_contact record.', default=None, ), Index('contact_id', 'contact_id'), Index('owner_contact_id', 'owner_id', 'contact_id'), Index('owner_id', 'owner_id'), comment='Contains list of contacts for the owner.', ) class OwnerDms(Base): __tablename__ = 'owner_dms' __table_args__ = {'comment': 'Holds list of DMS owner is allowed to handle.'} owner_dms_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to owner table.', ) dms_customer_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) payment_received_by: Mapped[str] = mapped_column( ENUM('orchard', 'owner'), nullable=False, server_default=text("'owner'"), comment="Party who receives the payment. Value can be 'orchard' or 'owner'.", ) class OwnerPaymentLevel(Base, UpdateMixin): __tablename__ = 'owner_payment_level' __table_args__ = ( Index('owner_id', 'owner_id', 'payment_level', unique=True), {'comment': 'DEPRECATED'}, ) payment_level_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to owner table.', ) payment_level: Mapped[str] = mapped_column( ENUM('vendor', 'artist', 'release'), nullable=False, server_default=text("'vendor'"), comment='Level of payment. Value can be vendor, artist or release.', ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the owner_payment_level record.', default=None, ) class OwnerSyncRevenue(Base): __tablename__ = 'owner_sync_revenue' __table_args__ = ( Index('country_id', 'country_id'), Index('invoice_detail_id', 'invoice_detail_id'), Index('owner_id', 'owner_id'), Index('track_id', 'track_id'), {'comment': 'Accounting table holds sync revenue for the partner.'}, ) owner_sync_revenue_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) owner_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to owner table', default=None ) invoice_detail_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to sync_invoice_detail table', default=None ) client_name: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Client name for OMS project', default=None, ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to track table', default=None ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table', default=None ) invoice_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of invoice', default=None ) revenue: Mapped[Optional[float]] = mapped_column( Float, comment='Total revenue', default=None ) class OwnerTarget(Base): __tablename__ = 'owner_target' __table_args__ = ( Index('owner_id', 'owner_id'), Index('owner_territory_id', 'owner_territory_id'), {'comment': '(DEPRECATED)'}, ) owner_target_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) target_type: Mapped[str] = mapped_column( ENUM( 'exclusive_track_unit', 'incentive_track_unit', 'exclusive_release_unit', 'incentive_release_unit', 'exclusive_new_receipt', 'incentive_net_receipt', ), nullable=False, server_default=text("'exclusive_track_unit'"), ) owner_territory_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) target_percentage: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) target_qty: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'") ) start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'") ) end_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'") ) incentive_applicable_from: Mapped[Optional[str]] = mapped_column( ENUM('current_quarter', 'current_year', 'next_quarter', 'current_term', 'date'), default=None, ) incentive_applicable_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) class OwnerTerritory(Base): __tablename__ = 'owner_territory' __table_args__ = ( Index( 'owner_id', 'owner_id', 'territory_id', 'exclusive', 'active', unique=True ), {'comment': 'DEPREACATED'}, ) owner_territory_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) owner_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to owner table.', ) territory_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to country table.', ) exclusive: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether owner has exclusivity in the territory.', ) active: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Yes or No indicates whether this record is active.', ) class P1EoPriorityReleases(Base): __tablename__ = 'p1_eo_priority_releases' release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Release which need to be delivered as EP1' ) class ParentCompany(Base): __tablename__ = 'parent_company' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Parent Company name', default=None ) uuid: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Parent Company uuid', default=None ) display_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Parent Company display name', default=None, ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='The date that parent company was updated', default=None, ) company_brand: Mapped[list['CompanyBrand']] = relationship( 'CompanyBrand', back_populates='parent_company', init=False ) class ParticipantExternalLinkIdsSeed(Base): __tablename__ = 'participant_external_link_ids_seed' __table_args__ = ( Index('subaccount_id', 'subaccount_id'), Index('vendor_id', 'vendor_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) store_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) subaccount_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) orchard_artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) store_artist_id: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class PaymentCalculator(Base): __tablename__ = 'payment_calculator' __table_args__ = (Index('idx_calculation_id__status', 'calculation_id', 'status'),) calculation_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) status: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'") ) time_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) time_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class PaymentCalculatorJob(Base): __tablename__ = 'payment_calculator_job' __table_args__ = ( Index('idx_calculation_id__job_id', 'calculation_id', 'job_id'), Index('uk_calculation__label_id', 'calculation_id', 'label_id', unique=True), ) job_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) calculation_id: Mapped[int] = mapped_column(INTEGER, nullable=False) label_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'") ) time_started: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) time_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class PaymentCalculatorStatus(Base): __tablename__ = 'payment_calculator_status' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) pid: Mapped[int] = mapped_column(INTEGER, nullable=False) progress: Mapped[int] = mapped_column(TINYINT, nullable=False) is_canceled: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'") ) vendors_total: Mapped[int] = mapped_column(INTEGER, nullable=False) time_started: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) params: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_unicode_ci'), default=None ) class PaymentLevel(Base): __tablename__ = 'payment_level' __table_args__ = ( Index('upc', 'upc', unique=True), Index('upc_payment_level', 'upc', 'payment_level', unique=True), {'comment': 'Holds payment level for different releases indicating the le'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) payment_level: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'artist', 'release'), server_default=text("'vendor'"), comment='Level of payment. Value can be vendor, artist or release.', default=None, ) acct_status: Mapped[Optional[str]] = mapped_column( ENUM('auto', 'manual', 'blocked'), server_default=text("'auto'"), comment='Status of the account.', default=None, ) class PaymentLog(Base): __tablename__ = 'payment_log' __table_args__ = ( Index('release_id', 'release_id'), {'comment': 'This table is used to log label payment information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) f_name: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='First name.', default=None ) l_name: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Last Name.', default=None ) address_1: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Street address.', default=None ) address_2: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Street address line 2.', default=None, ) city: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='City name.', default=None ) state_prov: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchard_state table.', default=None ) zip_code: Mapped[Optional[int]] = mapped_column( Integer, comment='Zip/postal code.', default=None ) country: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), comment='Country name.', default=None ) phone_number: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Phone number.', default=None ) release_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to release_tmp table.', default=None ) payment_amount: Mapped[Optional[float]] = mapped_column( Float, comment='Amount of the payment.', default=None ) date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date of the payment.', default=None, ) result: Mapped[Optional[str]] = mapped_column( String(6, 'utf8mb4_general_ci'), comment='Result of the payment.', default=None ) confirmation: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Confirmation text.', default=None ) email_sent: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the email is sent.', default=None, ) class PerformanceRightsDeliverySettings(Base): __tablename__ = 'performance_rights_delivery_settings' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) user_type: Mapped[str] = mapped_column( ENUM('vendor', 'subaccount'), nullable=False, comment='User Type for Performance Right Delivery Setting', ) user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='To store Vendor id or Subaccount id' ) rights_start_date_type: Mapped[Optional[str]] = mapped_column( ENUM('original_release_date', 'ingestion_date', 'custom_date'), server_default=text("'ingestion_date'"), comment='Date Type for Rights Start Date', default=None, ) custom_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Custom Date for the Rights Start Date.', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the user series information was last updated.', default=None, ) class Period(Base): __tablename__ = 'period' __table_args__ = ( Index('year_month', 'year', 'month', unique=True), Index('year_quarter', 'year', 'quarter'), ) period_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, autoincrement=True, init=False ) year: Mapped[int] = mapped_column(SMALLINT, nullable=False) quarter: Mapped[int] = mapped_column(TINYINT, nullable=False) month: Mapped[int] = mapped_column(TINYINT, nullable=False) status: Mapped[Optional[str]] = mapped_column( ENUM('open', 'closed', 'processing'), server_default=text("'open'"), default=None, ) currency_exchange_rates: Mapped[list['CurrencyExchangeRates']] = relationship( 'CurrencyExchangeRates', back_populates='period', init=False ) phf_publishing_escrow: Mapped[list['PhfPublishingEscrow']] = relationship( 'PhfPublishingEscrow', back_populates='period', init=False ) class PhfMechadminTrack(Base, UpdateMixin): __tablename__ = 'phf_mechadmin_track' __table_args__ = (Index('UK_phf_track_id', 'track_id', unique=True),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[str] = mapped_column( String(200, 'utf8mb4_general_ci'), nullable=False, comment='unique id generated by adding prefix "PHF" to existing Phonofile or Finetunes track id, not related to Orchard track_id.', ) original_track_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) company: Mapped[str] = mapped_column(ENUM('phonofile', 'finetunes'), nullable=False) track_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, server_default=text("''") ) track_artist: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, server_default=text("''") ) length_minute: Mapped[int] = mapped_column(SmallInteger, nullable=False) length_seconds: Mapped[int] = mapped_column(SmallInteger, nullable=False) release_date_calculated: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'2017-09-29'") ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) upc: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='this upc is Phonofile or Finetunes internal id, not related to Orchard upc.', default=None, ) isrc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), default=None ) label: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) public_domain: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) writer: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) original_publishers: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) publisher: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) release_date: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) release_title: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) release_artist: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) phf_publishing_escrow: Mapped[list['PhfPublishingEscrow']] = relationship( 'PhfPublishingEscrow', back_populates='track', init=False ) class PhfPublishingEscrowReleased(Base, UpdateMixin): __tablename__ = 'phf_publishing_escrow_released' __table_args__ = ( Index('phf_released_to_type', 'released_to_type', 'released_to'), Index('phf_transaction_id', 'phf_transaction_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincrement Primary key.', autoincrement=True, init=False, ) phf_transaction_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to phf_publishing_escrow table.' ) ownership: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'1'"), comment='Ownership released from phf_publishing_escrow.', ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), comment='Amount released. Field "royalty" from phf_publishing_escrow.', default=None, ) released_to_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'publisher', 'orchard'), server_default=text("'publisher'"), comment='Indicates the parent entry to which the escrow amount was released, in case of phonofile/finetunes sales data may be only equal to "publisher" for now.', default=None, ) released_to: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'1886'"), comment='Foreign key to the parent table which received the releases escrow, default to Harry Fox Agency publisher id.', default=None, ) publisher_code: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), comment='hfa_publisher_number from hfa_invoices_details', default=None, ) released_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Indicates the year of the period when escrow was released, based on hfa_period_code from hfa_invoices_details.', default=None, ) released_quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Indicates the quarter of the period when escrow was released, based on hfa_period_code from hfa_invoices_details.', default=None, ) released_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class PhysicalReleaseCountryDates(Base): __tablename__ = 'physical_release_country_dates' __table_args__ = ( Index('release_id', 'release_id'), Index('upc_country', 'upc', 'country_id', unique=True), ) release_country_date_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='UPC of the release. Serves as foreign key to releases table.', default=None, ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Release date for the associated country.', default=None ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table.', default=None ) class Pitch(Base): __tablename__ = 'pitch' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), Index('pitch_date', 'pitch_date'), {'comment': 'Stores pitches for particular releases'}, ) pitch_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to customer_master table.', default=None ) pitch_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the pitch.', default=None ) pitch_type: Mapped[Optional[str]] = mapped_column( ENUM('email', 'phone', 'in_person', 'flashlight', 'other'), comment='Pitch method. Value can be email, phone, in person, flashlight or other.', default=None, ) pitch_detail: Mapped[list['PitchDetail']] = relationship( 'PitchDetail', back_populates='pitch', init=False ) class PitchNote(Base): __tablename__ = 'pitch_note' __table_args__ = {'comment': 'Relationship table between pitch and note tables'} pitch_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) note_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) class PlaceholderUpc(Base): __tablename__ = 'placeholder_upc' upc: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) class Playlist(Base, CreateMixin): __tablename__ = 'playlist' __table_args__ = {'comment': 'Holds playlist information'} playlist_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) title: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Playlist title.' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date this playlist is last updated.', default=None ) date_created: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date this playlist is created.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of the playlist.', default=None, ) playlist_type: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'user'), server_default=text("'orchard'"), default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this playlist.', default=None, ) class PlaylistDetail(Base): __tablename__ = 'playlist_detail' __table_args__ = ( Index('playlist_id', 'playlist_id'), Index('upc', 'upc', 'cd', 'track_id'), {'comment': 'Holds playlist detailed information'}, ) playlist_detail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) playlist_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to playlist table.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) cd: Mapped[Optional[int]] = mapped_column( Integer, comment='CD volume number of the track.', default=None ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Track number of the track.', default=None ) rank_deprecated: Mapped[Optional[int]] = mapped_column(Integer, default=None) note: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class PlaylistPlaylistTag(Base): __tablename__ = 'playlist_playlist_tag' __table_args__ = {'comment': 'Links playlist with tags.'} playlist_tag_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) tag_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) playlist_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key referencing playlist table', default=None ) class PlaylistTags(Base): __tablename__ = 'playlist_tags' __table_args__ = { 'comment': 'Holds list of tags that could be applied to playlists.' } tag_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) tag: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) class Pnl(Base): __tablename__ = 'pnl' __table_args__ = {'comment': 'deprecated'} pnl_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) version_number: Mapped[Optional[int]] = mapped_column( Integer, comment='Denotes the version number of the pnl report.', default=None ) date_locked: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date pnl report was locked.', default=None ) locked_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table indicates which user locked the pnl report.', default=None, ) pm_adjustment_deadline: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The deadline date for Product managers to make adjustments.', default=None, ) average_label_share_precent: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the average label share percentage for the pnl period.', default=None, ) year: Mapped[Optional[int]] = mapped_column( Integer, comment='The year for the pnl period. This field together with quarter determines the period.', default=None, ) quarter: Mapped[Optional[int]] = mapped_column( Integer, comment='The quarter for the pnl period. This field together with year determines the period.', default=None, ) class PnlSales(Base): __tablename__ = 'pnl_sales' __table_args__ = ( Index('pnl_id', 'pnl_id'), Index('vendor_id', 'vendor_id'), {'comment': 'deprecated'}, ) pnl_sales_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) pnl_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to pnl table.', default=None ) year: Mapped[Optional[int]] = mapped_column( Integer, comment='The year for the pnl sales.', default=None ) quarter: Mapped[Optional[int]] = mapped_column( Integer, comment='The quarter for the pnl sales.', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) projection: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether or not the pnl sales entry is a projection.', default=None, ) priority: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the priority level of the pnl sales.', default=None ) class PnlSalesDetail(Base): __tablename__ = 'pnl_sales_detail' __table_args__ = ( Index('actual_sales_id', 'pnl_sales_id'), Index('dms_customer_id', 'dms_customer_id'), Index( 'pnl_sales_id', 'pnl_sales_id', 'dms_customer_id', 'trans_type', unique=True ), Index('trans_type', 'trans_type'), {'comment': 'deprecated'}, ) pnl_sales_detail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) pnl_sales_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to pnl_sales table.', default=None ) total_amount: Mapped[Optional[float]] = mapped_column( Float, comment='Total amount received.', default=None ) total_available: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the percentage of content available.', default=None ) total_active: Mapped[Optional[int]] = mapped_column( Integer, comment='Indicates total number of tracks active.', default=None ) percent_active: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the percentage of tracks active during the given time period.', default=None, ) trans_per_active: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the average number of transactions for the given time period.', default=None, ) dms_customer_id: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Indicates the list of applicable DMS for the pnl sales detail.', default=None, ) trans_type: Mapped[Optional[str]] = mapped_column( ENUM('Download_Album', 'Download_Track', 'Streaming', 'Mobile'), comment='Indicates the transaction type for the reported values.', default=None, ) rank_deprecated: Mapped[Optional[int]] = mapped_column(Integer, default=None) label_share_amount: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the label share of net receipts.', default=None ) class PnlSalesGenreDetail(Base): __tablename__ = 'pnl_sales_genre_detail' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), Index('genre', 'genre_id'), Index( 'genre_id', 'pnl_id', 'genre_id', 'year', 'quarter', 'dms_customer_id', 'trans_type', 'priority', unique=True, ), Index('pnl_id', 'pnl_id'), Index('trans_type', 'trans_type'), {'comment': 'deprecated'}, ) pnl_sales_genre_detail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) pnl_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to pnl table.', default=None ) dms_customer_id: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Indicates the list of applicable DMS for the pnl sales detail for the given genre.', default=None, ) trans_type: Mapped[Optional[str]] = mapped_column( ENUM('Download_Album', 'Download_Track', 'Streaming', 'Mobile'), comment='Indicates the transaction type for the reported values.', default=None, ) total_amount: Mapped[Optional[float]] = mapped_column( Float, comment='Total amount received.', default=None ) percent_active: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the percentage of tracks active during the given time period.', default=None, ) trans_per_active: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the average number of transactions for the given time period.', default=None, ) total_available: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the percentage of content available.', default=None ) rank_deprecated: Mapped[Optional[int]] = mapped_column(Integer, default=None) genre_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to the genre table.', default=None ) year: Mapped[Optional[int]] = mapped_column( Integer, comment='The year for the pnl sales.', default=None ) quarter: Mapped[Optional[int]] = mapped_column( Integer, comment='The quarter for the pnl sales.', default=None ) priority: Mapped[Optional[float]] = mapped_column( Float, comment='Indicates the priority level of the pnl sales genre detail.', default=None, ) class PpbTrashlist(Base): __tablename__ = 'ppb_trashlist' __table_args__ = (Index('blacklist_isrc', 'isrc'), Index('blacklist_upc', 'upc')) id: Mapped[int] = mapped_column(Integer, primary_key=True) vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) label: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) imprint: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) upc: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) release_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) track_artists: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) isrc: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) track_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) cd: Mapped[Optional[int]] = mapped_column(Integer, default=None) track_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) length_minute: Mapped[Optional[int]] = mapped_column(Integer, default=None) length_seconds: Mapped[Optional[int]] = mapped_column(Integer, default=None) Label_country: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) vendor_catalog_number: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) genre: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) track_composer: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) track_feature: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) abbrivation: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) p_line: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) track_type: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) reason_for_blacklist: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class PredefinedTask(Base): __tablename__ = 'predefined_task' __table_args__ = { 'comment': 'Stores a list of pre-defined tasks for use with customer ser' } predefined_task_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) type_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to ticket_type table.', default=None ) type_area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Functional area of the predefined task.', default=None, ) required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment="Yes or No indicates whether it's required.", default=None, ) description: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Descriptive text of the predefined task.', default=None, ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the predefined task is active.', default=None, ) task_order: Mapped[Optional[int]] = mapped_column( Integer, comment='Sort order of the predefined task.', default=None ) t_processed_dig_sales = Table( 'processed_dig_sales', Base.metadata, Column('statement_detail_id', BIGINT, nullable=False), Column('period_id', SMALLINT, default=None), Column('dms_customer_id', Integer, default=None), Column('date', NormalizedDate, default=None), Column('upc', BigInteger, default=None), Column('cd', TINYINT, default=None), Column('track_id', SMALLINT, default=None), Column('qty', Integer, default=None), Column('actual_net', DECIMAL(18, 6), default=None), Column('adjusted_gross', DECIMAL(18, 6), default=None), Column('distribution_fees', DECIMAL(18, 6), default=None), Column('dpd_publishing', DECIMAL(18, 6), default=None), Column('cloud_publishing', DECIMAL(18, 6), default=None), Column('gross', DECIMAL(18, 6), default=None), Column('net_receipt', DECIMAL(18, 6), default=None), Column('oms_fees', DECIMAL(18, 6), default=None), Column('partner_share', DECIMAL(18, 6), default=None), Column('ringtone_publishing', DECIMAL(18, 6), default=None), Column('trans_type', String(2, 'utf8mb4_general_ci'), default=None), Column('fx_spread_fee', DECIMAL(18, 6), comment='FX spread fee', default=None), Column( 'payout_currency_id', SmallInteger, comment="vendor's payout currency", default=None, ), Column( 'activity_rate', DECIMAL(18, 6), comment="Statement's activity rate", default=None, ), Column( 'fx_adjusted_exchange_rate', DECIMAL(18, 6), nullable=False, server_default=text("'1.000000'"), comment='FX adjusted exchange rate', ), Column('original_price', DECIMAL(18, 6), default=None), Column('discount', DECIMAL(18, 6), default=None), Index('period', 'period_id'), Index('statement_detail_id', 'statement_detail_id'), Index('upc', 'upc'), ) class ProcessedPhySales(Base): __tablename__ = 'processed_phy_sales' __table_args__ = ( Index('customer_id', 'customer_id'), Index('related_id', 'related_id'), Index('upc', 'upc'), {'comment': 'Static Accounting table holds processed physical sales data '}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) amount: Mapped[decimal.Decimal] = mapped_column(DECIMAL(18, 6), nullable=False) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Year of the sale.' ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Quarter of the sale.' ) entry_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) related_id_type: Mapped[str] = mapped_column( ENUM('sales', 'creditmemo', 'cost'), nullable=False ) related_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Type of the sales.' ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Foreign key to releases table.', default=None ) quantity: Mapped[Optional[float]] = mapped_column(Float, default=None) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class ProcessedRoyaltyCollection(Base): __tablename__ = 'processed_royalty_collection' __table_args__ = ( Index('period', 'year', 'quarter'), Index('track_unique_id', 'track_unique_id'), ) statement_detail_id: Mapped[int] = mapped_column(BIGINT, primary_key=True) year: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) quarter: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) collection_society_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date: Mapped[Optional[datetime.date]] = mapped_column(NormalizedDate, default=None) track_unique_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) distribution_fees: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) gross: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) net_receipt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) partner_share: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class ProductPhysicalPackaging(Base): __tablename__ = 'product_physical_packaging' __table_args__ = {'comment': 'Holds physical product packaging names'} id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) name: Mapped[str] = mapped_column(String(128, 'utf8mb4_general_ci'), nullable=False) display_flag: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) t_product_physical_reports_change_history = Table( 'product_physical_reports_change_history', Base.metadata, Column('product_id', INTEGER, nullable=False, comment='FK to releases.release_id'), Column( 'field_name', String(100, 'utf8mb4_general_ci'), nullable=False, comment='Name of field that changed', ), Column( 'date_changed', NormalizedDateTime, nullable=False, comment='Datetime when change occurred', ), Index('date_changed_idx', 'date_changed'), Index('physical_product_id', 'product_id'), ) class ProductPhysicalSupplyChainInfo(Base): __tablename__ = 'product_physical_supply_chain_info' __table_args__ = ( Index('unique_prod_store_ix', 'product_id', 'store_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='releases.release_id or product_physical.release_id', ) store_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='customer_master_master.customer_master_master_id', ) returnability: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Returnability status for stores', default=None ) return_disposition: Mapped[Optional[str]] = mapped_column( ENUM('Keep', 'Scrap'), comment='Return disposition status for stores', default=None, ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Records last updated date and time.', default=None ) class ProductSplit(Base): __tablename__ = 'product_split' __table_args__ = ( Index('product_id_UNIQUE', 'product_id', unique=True), Index('upc_idx', 'product_id'), ) product_split_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column(BigInteger, nullable=False) product_split_rate: Mapped[decimal.Decimal] = mapped_column( DECIMAL(6, 4), nullable=False ) vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) vendor_type: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) class ProductType(Base): __tablename__ = 'product_type' __table_args__ = {'comment': 'Holds product type names'} id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) product_type: Mapped[str] = mapped_column( String(10, 'utf8mb4_general_ci'), nullable=False ) product_subtype: Mapped[list['ProductSubtype']] = relationship( 'ProductSubtype', back_populates='product_type', init=False ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='product_type', init=False ) class Project(Base, UpdateMixin): __tablename__ = 'project' __table_args__ = ( Index('idx_artist_id', 'artist_id'), Index( 'project_idx1', 'project_code', 'vendor_id', 'subaccount_id', unique=True ), Index('project_idx2', 'vendor_id', 'subaccount_id', 'created_date_utc'), Index('project_subaccount_idx3', 'subaccount_id'), ) project_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table' ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Non-null subaccount_id where NULL is represented by 0', ) project_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_bin'), nullable=False ) created_date_utc: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='microsecond precision' ) updated_date_utc: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='microsecond precision' ) deletions: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether the project is deleted or not.', ) project_code: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_bin'), default=None ) correlation_id: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_bin'), comment='example: e4eaaaf2-d142-11e1-b3e4-080027620cdd', default=None, ) artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to artist_info table', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_bin'), comment='Descriptive text of the project.', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user oa or alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, comment='user_id who modified the project record.', default=None ) mkt_priority_project: Mapped[list['MktPriorityProject']] = relationship( 'MktPriorityProject', back_populates='project', init=False ) project_transfer_job: Mapped[list['ProjectTransferJob']] = relationship( 'ProjectTransferJob', back_populates='project', init=False ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='project', init=False ) class PromoCode(Base): __tablename__ = 'promo_code' __table_args__ = (Index('code', 'code', unique=True), {'comment': 'deprecated'}) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) code: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, comment='Promotion code.' ) company: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Company name.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) digital: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'49'"), comment='Percentage for digital use.', default=None, ) phys_digital: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'99'"), comment='Percentage for physical use.', default=None, ) ondemand: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'129'"), comment='Percentage for ondemand use.', default=None, ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Start date of the use of the promotion code.', default=None, ) exp_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Expiration date of the use of the promotion code.', default=None, ) used: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Number of times the promotion code is used.', default=None, ) type: Mapped[Optional[str]] = mapped_column( ENUM('one', 'many'), server_default=text("'many'"), comment='Type of the promotion code. Value can be one or many.', default=None, ) member_type: Mapped[Optional[str]] = mapped_column( ENUM('all', 'vendor', 'new_music'), server_default=text("'all'"), comment="Member type. Value can be 'all', 'vendor', or 'new_music'.", default=None, ) owner_type: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'amped'), server_default=text("'orchard'"), comment="Owner type. Value can be 'orchard' or 'amped'.", default=None, ) class ProperStockEssn(Base, UpdateMixin): __tablename__ = 'proper_stock_essn' __table_args__ = (Index('ean', 'ean'), Index('release_id', 'release_id')) catalogue_number: Mapped[str] = mapped_column( String(21, 'utf8mb4_general_ci'), primary_key=True ) on_hand: Mapped[int] = mapped_column(Integer, nullable=False) allocated: Mapped[int] = mapped_column(Integer, nullable=False) faulty: Mapped[int] = mapped_column(Integer, nullable=False) consignment: Mapped[int] = mapped_column(Integer, nullable=False) available: Mapped[int] = mapped_column(Integer, nullable=False) label_code: Mapped[str] = mapped_column( String(5, 'utf8mb4_general_ci'), primary_key=True ) ean: Mapped[str] = mapped_column(String(13, 'utf8mb4_general_ci'), primary_key=True) created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) class ProposalProposalTag(Base): __tablename__ = 'proposal_proposal_tag' __table_args__ = ( Index('proposal_id', 'proposal_id'), {'comment': 'Maps particular tags to proposals'}, ) proposal_tag_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) tag_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) proposal_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key referencing proposal table', default=None ) class ProposalResponse(Base): __tablename__ = 'proposal_response' __table_args__ = ( Index('proposal_id', 'proposal_id'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds responses of all proposals'}, ) proposal_response_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) proposal_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to proposals table' ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table' ) response_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date of response', ) class ProposalResponseList(Base): __tablename__ = 'proposal_response_list' __table_args__ = ( Index('last_status_changed_by', 'last_status_changed_by'), Index('proposal_response_id', 'proposal_response_id'), Index('response_id', 'response_id'), Index('status', 'status'), {'comment': 'Holds details of all responses of the proposals'}, ) response_list_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) proposal_response_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to proposal_response table' ) response_id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to vendor/releases/track table' ) status: Mapped[str] = mapped_column( ENUM('open', 'approved', 'rejected'), nullable=False, server_default=text("'open'"), ) last_status_change_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date & time of last change to the status. ', default=None, ) last_status_changed_by: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to orchadmin_users table that indicates who last changed the status.', default=None, ) track_note: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) playlist_order: Mapped[Optional[str]] = mapped_column( String(15, 'utf8mb4_general_ci'), default=None ) class ProposalTagsREMOVE(Base): __tablename__ = 'proposal_tags_REMOVE' __table_args__ = {'comment': 'Deprecated'} tag_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) tag: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) class ProposalTargetList(Base): __tablename__ = 'proposal_target_list' __table_args__ = ( Index('proposal_id', 'proposal_id'), Index('target_id', 'target_id'), Index('user_id', 'user_id'), {'comment': 'Holds label / release / track level detail of all proposals'}, ) target_list_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) proposal_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign Key referencing to alw_proposal table', ) target_id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Label, UPC, or track id' ) user_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class Proposals(Base, CreateMixin): __tablename__ = 'proposals' __table_args__ = ( Index('deadline', 'deadline'), Index('response_type', 'response_type'), Index('target_type', 'target_type'), {'comment': 'Holds proposals created in OA to labels'}, ) proposal_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key of alw_proposal table', autoincrement=True, init=False, ) title: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Proposal Title' ) response_type: Mapped[str] = mapped_column( ENUM('vendor', 'release', 'track'), nullable=False, server_default=text("'vendor'"), comment='Response Type', ) issue_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date of this proposal issued' ) description: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False, comment='Description of proposal', ) terms_conditions: Mapped[str] = mapped_column( MEDIUMTEXT, nullable=False, comment='Terms & conditions of the proposal' ) target_type: Mapped[str] = mapped_column( ENUM('vendor', 'release', 'track'), nullable=False, server_default=text("'vendor'"), comment='Proposal target type', ) optin_or_out: Mapped[str] = mapped_column( ENUM('in', 'out'), nullable=False, comment='Opt-in or Opt-out' ) logo_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Logo URL', default=None ) deadline: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of deadline of this proposal', default=None ) trackdown_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='This title will be shown to trackdown users instead of the real title.', default=None, ) trackdown_sticker: Mapped[Optional[str]] = mapped_column( ENUM('Just for you', 'Library'), default=None ) highlight_in_trackdown: Mapped[Optional[str]] = mapped_column( ENUM('y', 'n'), default=None ) trackdown_note: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class ProspectiveLabel(Base): __tablename__ = 'prospective_label' __table_args__ = { 'comment': 'Holds prospective labels information who submit contact form' } prospective_label_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) login: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Usename of the prospective label.', default=None, ) password: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Password of the prospective label.', default=None, ) contact_name: Mapped[Optional[str]] = mapped_column( String(140, 'utf8mb4_general_ci'), comment='Contact name of the prospective label.', default=None, ) email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Email address of the prospective label.', default=None, ) phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Phone number of the prospective label.', default=None, ) address_street: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Street address of the prospective label.', default=None, ) address2: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Street address line 2 of the prospective label.', default=None, ) city: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='City name of the prosepctive label.', default=None, ) state: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Foreign key to orchard_state table.', default=None ) state_other: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='State name if not found in orchard state list.', default=None, ) zipcode: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Zip/postal code.', default=None ) country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table.', default=None ) website: Mapped[Optional[str]] = mapped_column( String(156, 'utf8mb4_general_ci'), comment='Website URL of the prospective label.', default=None, ) genre_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Foreign key to the genre table.', default=None ) phys_distributor: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Physical distributor of the prospective label.', default=None, ) full_length_album: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Number of full length album the prospective label has.', default=None, ) top_artist_1: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Top artist name 1.', default=None ) top_artist_2: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Top artist name 2.', default=None ) top_artist_3: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Top artist name 3.', default=None ) short_overview: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Short descriptive text of the overview of the prospective lable.', default=None, ) orchard_accepted: Mapped[Optional[str]] = mapped_column( ENUM('accepted', 'rejected', 'new'), server_default=text("'new'"), comment='Orchard acceptance status. Value can be new, accepted or rejected.', default=None, ) label_accepted: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment="Yes or No indicates whether the prospective label accepted Orchard's acceptance.", default=None, ) transferred: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Yes or No indicates whether the prospective label is transferred to OA content.', default=None, ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='If Approved and Transferred Vendor ID for this Label from vendor table.', default=None, ) date_signedup: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the prospective label registered online.', default=None, ) date_processed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the prospective label is accepted.', default=None ) company: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Company name of the prospective label.', default=None, ) owner: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Owner information of the prospective label.', default=None, ) ca_rep: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='CA Rep for this Label.', default=None ) type_of_content: Mapped[Optional[str]] = mapped_column( ENUM('music', 'video', 'music_and_video'), default=None ) top_title_1: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) top_title_2: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) top_title_3: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class PublisherAccounting(Base): __tablename__ = 'publisher_accounting' __table_args__ = ( Index('publisher_id', 'publisher_id'), Index( 'unique_row_constraint', 'period_id', 'entry_type', 'publisher_id', unique=True, ), {'comment': 'Static accounting table holds accounting details for the pub'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) publisher_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreing key to publishers table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) entry_type: Mapped[str] = mapped_column( ENUM( 'balance_forward', 'carried_over_balance', 'opening_balance', 'royalty_payable', 'advances', 'outstanding_balance', 'ringtone_royalty', 'mechanical_royalty', 'server_fixation_fees', 'checkspaid', 'manual_adjustment', ), nullable=False, comment='The entry type for line item.', ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='The total amount for the line item.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class PublisherLicenseTypes(Base): __tablename__ = 'publisher_license_types' id: Mapped[int] = mapped_column( SmallInteger, primary_key=True, autoincrement=True, init=False ) TYPE: Mapped[str] = mapped_column(String(25, 'utf8mb4_general_ci'), nullable=False) description: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) class PublisherStatement(Base): __tablename__ = 'publisher_statement' __table_args__ = ( Index('publisher_id', 'publisher_id'), {'comment': 'Static accounting table holds header information for publish'}, ) publisher_statement_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) publisher_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to publishers table.', ) date_added: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date the publisher statement is added.', ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, server_default=text("'0'"), comment='Year of the publisher statement.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'"), comment='Quarter of the publisher statement.', ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class PublisherStatementDetail(Base): __tablename__ = 'publisher_statement_detail' __table_args__ = ( Index('license_no', 'license_no'), Index('publisher_statement_id', 'publisher_statement_id'), Index('track_id', 'track_id'), {'comment': 'Static accounting table holds detailed royalty information f'}, ) publisher_statement_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) publisher_statement_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to publisher_statement table.', ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to track table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) trans_type: Mapped[str] = mapped_column( ENUM('DPD', 'DR', 'RB', 'SFF'), nullable=False, server_default=text("'DPD'"), comment="Transaction type. Value can be 'DT', 'DA', 'S', 'DR', 'TD', or 'RB'", ) qty: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Quantity of the transaction for the track.' ) ownership: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Ownership percentage of the track license for the publisher.', ) royalty_rate: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Royalty rate of the track.', ) royalty: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Royalty amount.' ) license_no: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='License number.' ) year: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Year of the publisher statement detail item.', default=None ) quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Quarter of the publisher statement detail item.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) dig_statement_detail_id: Mapped[Optional[int]] = mapped_column( BigInteger, default=None ) class Publishers(Base): __tablename__ = 'publishers' __table_args__ = {'comment': 'Holds publisher information'} publisher_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) publisher: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Publisher name.' ) pro: Mapped[Optional[str]] = mapped_column( ENUM('NONE', 'BMI', 'ASCAP', 'SESAC', 'SOCAN'), comment="Performing rights organization type. Value can be 'NONE', 'BMI', 'ASCAP', 'SESAC', or 'SOCAN'.", default=None, ) type: Mapped[Optional[str]] = mapped_column( ENUM('parent', 'sub_publisher'), comment="Type of publisher. Value can be 'parent' or 'sub_publisher'.", default=None, ) payee: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Payee information to whom the check should be paid to.', default=None, ) tax_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Tax id of the payee.', default=None ) status: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Status of the publisher.', default=None, ) external_publisher_id: Mapped[Optional[str]] = mapped_column( String(12, 'utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the publisher is added.', default=None ) added_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this publisher.', default=None, ) ringtone_flat_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Ringtone flat rate number.', default=None ) ringtone_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Ringtone percentage number.', default=None ) ringtone_percentage_based_on: Mapped[Optional[str]] = mapped_column( ENUM('wholesale', 'retail'), server_default=text("'wholesale'"), comment='Ringtone percentage based on information. Value can be wholesale or retail.', default=None, ) mfn: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the publisher has MFN clause.', default=None, ) advance: Mapped[Optional[float]] = mapped_column( Float, comment='Advance payment number for the publisher.', default=None ) ringback_percentage_based_on: Mapped[Optional[str]] = mapped_column( ENUM('wholesale', 'retail'), server_default=text("'wholesale'"), comment='Ringback percentage based on information. Value can be wholesale or retail.', default=None, ) ringback_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Ringback percentage number.', default=None ) ringback_flat_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Ringback flat rate number.', default=None ) payment_threshhold: Mapped[Optional[float]] = mapped_column( Float, comment='Payment threshold number.', default=None ) server_fixation_fees: Mapped[Optional[float]] = mapped_column( Float, comment='Server fixation fee amount.', default=None ) class PublishersCheckspaid(Base, UpdateMixin): __tablename__ = 'publishers_checkspaid' __table_args__ = ( Index('publisher_id', 'publisher_id'), Index('track_id', 'track_id'), {'comment': 'Accounting table contains checks paid to publishers.'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) entry_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date of this entry of the check.', default=None ) publisher_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to publishers table.', default=None ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to track table.', default=None ) cut_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Cut date of the check.', default=None ) cash_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Cash date of the check.', default=None ) check_payable: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Check payable information.', default=None, ) check_no: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Check number.', default=None ) check_amt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount paid on the check.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) paidfor_type: Mapped[Optional[str]] = mapped_column( ENUM('mechanical', 'ringtone'), comment="Check paid for type. Value can be 'mechanical' or 'ringtone'.", default=None, ) check_amt_OLD: Mapped[Optional[float]] = mapped_column(Float, default=None) paidfor_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the publishers_checkspaid record.', default=None, ) class PublishersContact(Base): __tablename__ = 'publishers_contact' __table_args__ = { 'comment': 'Intermediary table that holds many to many relationships bet' } publisher_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to publishers table.', ) contact_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to contact table.', ) acct_receivable: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Yes or No indicates whether the contact is the account receivable.', ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) class PublishersLicense(Base): __tablename__ = 'publishers_license' __table_args__ = ( Index('publisher_id', 'publisher_id'), Index('rf_license_id', 'rf_license_id', unique=True), Index('track_id', 'track_id'), {'comment': 'Holds publisher licenses'}, ) license_no: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) publisher_license_no: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Publisher license number.', default=None, ) track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to track table.', default=None ) publisher_id: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) effective_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment="Effective date of the publisher's license.", default=None, ) expiration_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment="Expiration date of the publisher's license.", default=None, ) status: Mapped[Optional[str]] = mapped_column( ENUM('executed', 'expired', 'pending', 'public_domain', 'label_controlled'), comment="Status of the publisher's license. Value can be 'executed', 'expired', 'pending', 'public_domain', or 'label_controlled'.", default=None, ) ownership: Mapped[Optional[float]] = mapped_column( Float, comment='Ownership percentage of the track license for the publisher.', default=None, ) date_added: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment="Date the publisher's license is added.", default=None ) added_by: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who added this publisher's license.", default=None, ) execution_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment="Execution date of the publisher's license.", default=None, ) license_type: Mapped[Optional[str]] = mapped_column( ENUM('dpd', 'ringtone'), server_default=text("'dpd'"), comment='Type of license. Value can be dpd or ringtone.', default=None, ) rf_license_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) compulsory: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) class PublishingAdminContract(Base, CreateMixin): __tablename__ = 'publishing_admin_contract' __table_args__ = ( Index('vendor_id', 'vendor_id'), Index('vendor_type', 'vendor_type'), {'comment': 'DEPRECATED'}, ) pa_contract_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) commission: Mapped[Optional[float]] = mapped_column( Float, comment='Commission in percentage', default=None ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='start date of the term', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='end date of the term', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='vendor or oms client id', default=None ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), comment='choose whether it is vendor or oms client', default=None, ) territory: Mapped[Optional[str]] = mapped_column( TEXT, comment='territory', default=None ) limit_grant_of_rights: Mapped[Optional[str]] = mapped_column( VARCHAR(50), comment='text field to note rights limited', default=None ) misc_previsions: Mapped[Optional[str]] = mapped_column( VARCHAR(50), comment='text field to note previsions', default=None ) closer: Mapped[Optional[int]] = mapped_column( Integer, comment='orchadmin user who close', default=None ) date_entered: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='date this contract is entered', default=None ) contract_complete: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='whether contract is finalized or not', default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='orchadmin user who created this contract', default=None ) class PublishingEscrow(Base): __tablename__ = 'publishing_escrow' __table_args__ = ( Index('period_id', 'period_id'), Index('statement_detail_id', 'statement_detail_id'), Index('track_id', 'track_id'), {'comment': 'Static accounting table holds publishing royalty in escrow.'}, ) escrow_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) statement_detail_id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to dig_sales_detail table.' ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track table.' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Indicates the year of the period for which the pubilshing escrow applies.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Indicates the quarter of the period for which the pubilshing escrow applies.', ) trans_type: Mapped[str] = mapped_column( String(4, 'utf8mb4_general_ci'), nullable=False, comment='The transaction type for the publishing escrow.', ) qty: Mapped[int] = mapped_column( Integer, nullable=False, comment='Total quantity for the transaction.' ) ownership: Mapped[float] = mapped_column( Float, nullable=False, comment='Total ownership of the track in escrow.' ) royalty_rate: Mapped[float] = mapped_column( Float, nullable=False, comment='Royalty rate applied for escrow.' ) royalty: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='Total royalty amount in escrow.' ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class PublishingEscrowErrors(Base): __tablename__ = 'publishing_escrow_errors' __table_args__ = { 'comment': 'Static accounting table holds lists of escrow items not bein' } escrow_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) comment: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) class PublishingEscrowReleased(Base, UpdateMixin): __tablename__ = 'publishing_escrow_released' __table_args__ = ( Index('escrow_id', 'escrow_id'), Index('released_to_type', 'released_to_type', 'released_to'), {'comment': 'Static accounting table holds the detailed information on re'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) escrow_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to publishing_escrow table.' ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount released.', default=None ) ownership: Mapped[Optional[float]] = mapped_column( Float, comment='Ownership released.', default=None ) released_to_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'publisher', 'orchard'), comment='Indicates the parent entry to which the escrow amount was released.', default=None, ) released_to: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to the parent table which received the releases escrow.', default=None, ) publisher_code: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) released_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Indicates the year of the period when escrow was released.', default=None, ) released_quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Indicates the quarter of the period when escrow was released.', default=None, ) released_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class QqYyCosts(Base): __tablename__ = 'qq_yy_costs' __table_args__ = ( Index('upc', 'upc'), {'comment': 'Physical sales table holds details of physical distribution '}, ) customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Year of the transaction.' ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Quarter of the transaction.' ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Foreign key to release table.', default=None ) quantity: Mapped[Optional[float]] = mapped_column( Float, comment='Quantity of the transaction for the release.', default=None ) picking_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Picking fee associated with the release.', default=None ) shipping_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Shipping cost associated with the relaese.', default=None ) restocking_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Re-stocking fee associated with the release.', default=None ) pull_from_inventory: Mapped[Optional[float]] = mapped_column( Float, comment='Number of pulls from inventory.', default=None ) reorder_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Re-order fee associated with the release.', default=None ) total: Mapped[Optional[float]] = mapped_column( Float, comment='Total cost associated with the release.', default=None ) breakage: Mapped[Optional[float]] = mapped_column( Float, comment='Breakage of the transaction.', default=None ) date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the transaction.', default=None ) other_fee_type: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Type of other fee.', default=None ) other_fee: Mapped[Optional[float]] = mapped_column( Float, comment='Other fee amount.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class QqYyCreditmemo(Base): __tablename__ = 'qq_yy_creditmemo' __table_args__ = ( Index('customer_return_id', 'customer_return_id'), Index('upc', 'upc'), {'comment': 'Physical returns table holds details of returns/creditmemoes'}, ) date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date of the credit.' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to customer_master table.' ) quantity: Mapped[float] = mapped_column( Float, nullable=False, comment='Foreign key to releases table.' ) unit_price: Mapped[float] = mapped_column( Float, nullable=False, comment='Unit price for the credit.' ) actual_price: Mapped[float] = mapped_column( Float, nullable=False, comment='Actual amount for the credit.' ) total: Mapped[float] = mapped_column( Float, nullable=False, comment='Total credit associated with the release.' ) year: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Year of the credit.' ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Quarter of the credit.' ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) customer_return_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to customer_return table.' ) invoice_no: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Invoice number.', default=None ) customer: Mapped[Optional[str]] = mapped_column( String(35, 'utf8mb4_general_ci'), comment='Customer name.', default=None ) discount: Mapped[Optional[float]] = mapped_column( Float, comment='Discount percentage for the credit.', default=None ) po: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Purchase order number.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class QqYySales(Base): __tablename__ = 'qq_yy_sales' __table_args__ = ( Index('customer_order_id', 'customer_order_id'), Index('upc', 'upc'), {'comment': 'Physical sales table holds details of physical releases sold'}, ) id: Mapped[int] = mapped_column( BigInteger, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) invoice_no: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Invoice number.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) quantity: Mapped[Optional[float]] = mapped_column( Float, comment='Quantity of the sales for the release.', default=None ) unit_price: Mapped[Optional[float]] = mapped_column( Float, comment='Unit price for the sales of the release.', default=None ) discount: Mapped[Optional[float]] = mapped_column( Float, comment='Discount percentage for the slaes.', default=None ) actual_Price: Mapped[Optional[float]] = mapped_column( Float, comment='Actual amount for the sales.', default=None ) total: Mapped[Optional[float]] = mapped_column( Float, comment='Total amount of the sales.', default=None ) year: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Year of the sales.', default=None ) quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Quarter of the sales.', default=None ) po: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Purchase order number.', default=None ) type: Mapped[Optional[str]] = mapped_column( ENUM('physical', 'digital'), server_default=text("'physical'"), comment='Type of the sales.', default=None, ) date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the slaes.', default=None ) customer_order_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to customer_order table.', default=None ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class RatingAdvisorySystem(Base): __tablename__ = 'rating_advisory_system' __table_args__ = ( Index('system', 'system_code', 'video_type', 'type', 'code', unique=True), {'comment': 'Holds static rating and advisory texts'}, ) rating_advisory_system_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key for Rating Asvisory System table.', autoincrement=True, init=False, ) system_code: Mapped[Optional[str]] = mapped_column( ENUM( 'mpaa', 'bbfc', 'au-tv', 'ca-tv', 'de-tv', 'fr-tv', 'uk-tv', 'us-tv', 'us-cable', 'jp-tv', 'au-oflc', 'ca-chvrs', 'de-fsk', 'fr-cnc', 'jp-eirin', 'nz-oflc', 'ar-movies', 'fsk', 'be-movies', 'nl-movies', 'lu-movies', 'bo-movies', 'br-movies', 'bg-movies', 'cl-movies', 'co-movies', 'cr-movies', 'cy-movies', 'cz-movies', 'dk-movies', 'do-movies', 'ec-movies', 'sv-movies', 'ee-movies', 'fi-movies', 'gr-movies', 'gt-movies', 'gy-movies', 'hn-movies', 'hu-movies', 'ie-ifco', 'it-movies', 'jm-movies', 'lv-movies', 'mt-movies', 'mx-movies', 'ni-movies', 'no-movies', 'pa-movies', 'py-movies', 'pe-movies', 'pl-movies', 'pt-movies', 'ca-rcq', 'ro-movies', 'sk-movies', 'si-movies', 'es-movies', 'sr-movies', 'se-movies', 'ch-movies', 'uy-movies', 've-movies', 'lt-movies', 'ai-movies', 'ag-movies', 'am-movies', 'az-movies', 'bs-movies', 'bh-movies', 'bb-movies', 'by-movies', 'bz-movies', 'bm-movies', 'bw-movies', 'vg-movies', 'bn-movies', 'bf-movies', 'kh-movies', 'cv-movies', 'ky-movies', 'dm-movies', 'eg-movies', 'fm-movies', 'fj-movies', 'gm-movies', 'gh-movies', 'gd-movies', 'gw-movies', 'hk-movies', 'in-movies', 'id-movies', 'il-movies', 'jo-movies', 'kz-movies', 'ke-movies', 'kr-movies', 'kg-movies', 'la-movies', 'lb-movies', 'mo-movies', 'my-movies', 'mu-movies', 'md-movies', 'mn-movies', 'mz-movies', 'na-movies', 'np-movies', 'ne-movies', 'ng-movies', 'om-movies', 'pg-movies', 'ph-movies', 'qa-movies', 'ru-movies', 'kn-movies', 'sa-movies', 'sg-movies', 'za-movies', 'lk-movies', 'sz-movies', 'tw-movies', 'tj-movies', 'th-movies', 'tt-movies', 'tr-movies', 'tm-movies', 'ug-movies', 'ua-movies', 'ae-movies', 'uz-movies', 'vn-movies', 'zw-movies', ), default=None, ) video_type: Mapped[Optional[str]] = mapped_column( ENUM('film', 'tv'), comment='Type of video', default=None ) type: Mapped[Optional[str]] = mapped_column( ENUM('rating', 'advisory'), comment='System type', default=None ) code: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Rating/Advisory code', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Rating/Advisory description', default=None, ) release_rating_advisory_system: Mapped[list['ReleaseRatingAdvisorySystem']] = ( relationship( 'ReleaseRatingAdvisorySystem', back_populates='rating_advisory_system', init=False, ) ) class ReasonType(Base): __tablename__ = 'reason_type' reason_type_id: Mapped[int] = mapped_column(Integer, primary_key=True) reason_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) reason: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class ReceiveNewRelease(Base): __tablename__ = 'receive_new_release' __table_args__ = ( Index('release_id', 'release_id'), Index('upc', 'upc'), {'comment': 'This table is only used to log label payment information cur'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='UPC code of the new release.', default=None ) release_id: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Foreign key to release_tmp table.', default=None, ) cd_receive_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the CD is received.', default=None ) cd_receive_user: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who entered this release.', default=None, ) cd_receive_qty: Mapped[Optional[int]] = mapped_column( Integer, comment='Quantity of the CD received.', default=None ) cd_receive_location: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'amped'), comment="Location of the CD received. Value can be 'orchard' or 'amped'.", default=None, ) cont_receive_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the contract is received.', default=None ) cont_receive_user: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who entered receive the contract.', default=None, ) cont_owner: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'emd', 'odd'), comment="Contract owner. Value can be 'orchard', 'emd', or 'odd'.", default=None, ) cont_distribution: Mapped[Optional[str]] = mapped_column( ENUM('digital', 'phys/digital', 'ondemand'), comment="Contract distribution type. Value can be 'digital', 'phys/digital', or 'ondemand'.", default=None, ) cont_version: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Contract version.', default=None ) cont_signed_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the contract is signed.', default=None ) cont_receive_location: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'amped'), comment="Location where the contract is received. Value can be 'orchard' or 'amped'.", default=None, ) paymt_receive_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the payment is received.', default=None ) paymt_receive_user: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users. Stores the ID of the orchadmin user who received the payment.', default=None, ) paymt_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the payment.', default=None ) paymt_type: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Type of payment.', default=None ) applfees: Mapped[Optional[float]] = mapped_column( Float, comment='Application fee number.', default=None ) paymt_comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Payment comments.', default=None ) paymt_receive_location: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'amped'), comment='Payment receive location information.', default=None, ) data_confirmed: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Date of confirmation of the receipt.', default=None, ) class RedEssentialLabelMapping(Base): __tablename__ = 'red_essential_label_mapping' vendor_id: Mapped[int] = mapped_column(Integer, primary_key=True) red_essential_label_code: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) company_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) red_essential_label_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class Region(Base): __tablename__ = 'region' __table_args__ = {'comment': 'Stores a list of regions'} region_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) region_code: Mapped[str] = mapped_column( String(3, 'utf8mb4_general_ci'), nullable=False, comment='Region code.' ) region: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, comment='Region name.' ) country: Mapped[list['Country']] = relationship( 'Country', secondary='region_country', back_populates='region', init=False ) class Release16x9ThumbnailImages(Base): __tablename__ = 'release_16x9_thumbnail_images' __table_args__ = ( Index('FK_release_16x9_thumbnail_images_image_assets', 'image_asset_id'), Index('FK_release_16x9_thumbnail_images_releases', 'upc'), ) release_16x9_thumbnail_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseAccounting(Base): __tablename__ = 'release_accounting' __table_args__ = ( Index('period_id', 'period_id'), Index('unique_constraint', 'entry_type', 'upc', 'period_id', unique=True), Index('upc', 'upc'), {'comment': 'Static accounting table holds release level accounting entri'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BigInteger, nullable=False, comment='Foreing key to releases table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='The total amount for the line item.' ) entry_type: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='The entry type for line item.', ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class ReleaseAccountingSums(Base): __tablename__ = 'release_accounting_sums' __table_args__ = ( Index('upc', 'upc', unique=True), Index('upc_sums', 'upc', 'dig_actual_net', 'phy_actual_net'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) last_updated_period_id: Mapped[int] = mapped_column(INTEGER, nullable=False) dig_actual_net: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), server_default=text("'0.000000'"), default=None ) phy_actual_net: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), server_default=text("'0.000000'"), default=None ) class ReleaseAssetErrorType(Base): __tablename__ = 'release_asset_error_type' __table_args__ = { 'comment': 'Contains list of different errors related to release assets ' } id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) error: Mapped[str] = mapped_column(String(50, 'utf8mb4_general_ci'), nullable=False) error_type: Mapped[str] = mapped_column( ENUM('audio', 'image', 'metadata'), nullable=False, server_default=text("'audio'"), ) class ReleaseAssetErrors(Base): __tablename__ = 'release_asset_errors' __table_args__ = ( Index('upc', 'upc', 'error_type_id', unique=True), {'comment': 'Contains lists of actual errors related to release assets.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BigInteger, nullable=False) error_type_id: Mapped[int] = mapped_column(INTEGER, nullable=False) error_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class ReleaseAssetUpdates(Base): __tablename__ = 'release_asset_updates' __table_args__ = (Index('release_id', 'release_id'),) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class ReleaseAssetVersion(Base): __tablename__ = 'release_asset_version' release_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) api_version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), server_default=text("'v2'"), default=None ) class ReleaseBubbling(Base): __tablename__ = 'release_bubbling' __table_args__ = ( Index('country_id', 'country_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) class ReleaseCountryDates(Base): __tablename__ = 'release_country_dates' __table_args__ = ( Index('release_id', 'release_id'), Index('upc_country', 'upc', 'country_id', unique=True), ) release_country_date_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='UPC of the release. Serves as foreign key to releases table.', default=None, ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Release date for the associated country.', default=None ) sale_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Sale start date for the associated country.', default=None, ) vod_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='vod start date for the associated country', default=None, ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table.', default=None ) preorder_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Preorder date for the associated country.', default=None, ) class ReleaseCoverCorrectionImages(Base): __tablename__ = 'release_cover_correction_images' __table_args__ = ( Index('FK_release_cover_images_image_assets', 'image_asset_id'), Index('FK_release_cover_images_releases', 'upc'), ) release_cover_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseCoverImages(Base): __tablename__ = 'release_cover_images' __table_args__ = ( Index('FK_release_cover_images_image_assets', 'image_asset_id'), Index('FK_release_cover_images_releases', 'upc'), ) release_cover_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseDefaultDmsMasterRestriction(Base): __tablename__ = 'release_default_dms_master_restriction' __table_args__ = ( Index('distribution_type_id', 'distribution_type_id'), Index('release_id', 'release_id'), Index('unique_key', 'upc', 'distribution_type_id', unique=True), ) default_restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) distribution_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to distribution_type table' ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) class ReleaseDmsMasterRestriction(Base): __tablename__ = 'release_dms_master_restriction' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('distribution_type_id', 'distribution_type_id'), Index('release_id', 'release_id'), Index( 'unique_key', 'upc', 'customer_master_master_id', 'distribution_type_id', unique=True, ), ) restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master_master table' ) distribution_type_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to distribution_type table' ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Last update timestamp', ) updated_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) release_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to releases table', default=None ) t_release_instrument = Table( 'release_instrument', Base.metadata, Column( 'upc', BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ), Column( 'instrument_id', Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to instrument table.', ), Index('upc_instrument', 'upc', 'instrument_id', unique=True), comment='Relationship table between releases and instrument tables', ) class ReleaseLarge16x9ThumbnailImages(Base): __tablename__ = 'release_large_16x9_thumbnail_images' __table_args__ = ( Index('FK_release_large_16x9_thumbnail_images_images_assets', 'image_asset_id'), Index('FK_release_large_16x9_thumbnail_images_releases', 'upc'), ) release_large_16x9_thumbnail_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseLargeCoverCorrectionImages(Base): __tablename__ = 'release_large_cover_correction_images' __table_args__ = ( Index('FK_release_large_cover_images_image_assets', 'image_asset_id'), Index('FK_release_large_cover_images_releases', 'upc'), ) release_large_cover_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseLargeCoverImages(Base): __tablename__ = 'release_large_cover_images' __table_args__ = ( Index('FK_release_large_cover_images_image_assets', 'image_asset_id'), Index('FK_release_large_cover_images_releases', 'upc'), ) release_large_cover_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseLargePosterImages(Base): __tablename__ = 'release_large_poster_images' __table_args__ = ( Index('FK_release_large_poster_images_images_assets', 'image_asset_id'), Index('FK_release_large_poster_images_releases', 'upc'), ) release_large_poster_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) t_release_mood = Table( 'release_mood', Base.metadata, Column( 'upc', BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ), Column( 'mood_id', Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to mood table.', ), Index('upc_mood', 'upc', 'mood_id', unique=True), comment='Relationship table between releases and mood tables', ) class ReleasePosterImages(Base): __tablename__ = 'release_poster_images' __table_args__ = ( Index('FK_release_poster_images_image_assets', 'image_asset_id'), Index('FK_release_poster_images_releases', 'upc'), ) release_poster_images_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) class ReleaseScheduleDashboardChangeHistory(Base): __tablename__ = 'release_schedule_dashboard_change_history' __table_args__ = (Index('changed_by', 'changed_by'), Index('uid', 'uid')) id: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) saved_query_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) changed_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) change_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) criteria: Mapped[Optional[str]] = mapped_column( ENUM( 'ReleaseDate', 'ReleaseDateByCountry', 'SaleStartDate', 'Exclusivity', 'PhysicalReleaseDateByCountry', 'ArtistName', 'ReleaseName', 'LabelImprint', 'Genre', 'GenreNote', 'Status', 'AssignedTo', 'UPC', 'ManufacturerUPC', 'ProductFormat', 'NewCatalog', 'LabelCatalog', 'TerritoryRestrictions', 'DSPCarveOuts', 'Account', 'AudioReceived', 'ArtReceived', 'DateAdded', 'RetailPriorityLevel', 'IMPriorityLevel', 'MarketingBlurb', 'OneSheet', 'Tracks', 'FocusTracks', 'BonusTrack', 'FreeTrack', 'PDFReceived', 'PricingTiers', 'Comment', 'Highlighted', ), default=None, ) uid: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) isCatalog: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) old_value: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) new_value: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class ReleaseStatus(Base): __tablename__ = 'release_status' __table_args__ = (Index('release_id', 'release_id'),) release_status_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) release_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to release table.', ) status: Mapped[str] = mapped_column( ENUM( 'orchard_processing', 'label_confirmation', 'transfer_to_content', 'label_processing', 'in_content', ), nullable=False, server_default=text("'orchard_processing'"), comment='Release status.', ) date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date the release status is changed.', ) changed_by: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foregn key to orchadmin_users table. Stores ID of the orchadmin user who changed the release status.', ) updated_timestamp: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) changed_by_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oa', 'system'), server_default=text("'system'"), comment='Type of ID entered in the change_by field. Example: OA or Vendor or System', default=None, ) upc_REMOVED: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Foreign key to release table.', default=None ) release_approval_comments: Mapped[list['ReleaseApprovalComments']] = relationship( 'ReleaseApprovalComments', back_populates='release_status', init=False ) class ReleaseSubgenreOLD(Base): __tablename__ = 'release_subgenre_OLD' __table_args__ = ( Index('release_id', 'release_id'), Index('subgenre_id', 'subgenre_id'), Index('upc', 'upc'), ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to release table.', default=None ) subgenre_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to subgenre table.', default=None ) class ReleaseTag(Base): __tablename__ = 'release_tag' __table_args__ = ( Index('tag_id', 'tag_id'), Index('upc', 'upc', 'tag_id', unique=True), {'comment': 'Maps particular tags to releases in catalog'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BigInteger, nullable=False) tag_id: Mapped[int] = mapped_column(INTEGER, nullable=False) t_release_theme = Table( 'release_theme', Base.metadata, Column( 'upc', BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to release table.', ), Column( 'theme_id', Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to theme table.', ), Index('upc_theme', 'upc', 'theme_id', unique=True), comment='Relationship table between releases and theme', ) class ReleaseType(Base): __tablename__ = 'release_type' release_type_id: Mapped[int] = mapped_column(Integer, primary_key=True) release_type: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) video_dashboard_item: Mapped[list['VideoDashboardItem']] = relationship( 'VideoDashboardItem', back_populates='release_type', init=False ) class ReleaseVideoLinks(Base): __tablename__ = 'release_video_links' __table_args__ = (Index('release_id', 'release_id'),) url_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) name: Mapped[str] = mapped_column(String(50, 'utf8mb4_general_ci'), nullable=False) url: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) class ReorderDetail(Base): __tablename__ = 'reorder_detail' __table_args__ = ( Index('reorder_id', 'reorder_id'), Index('upc', 'upc'), {'comment': 'Contains reorder details.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) reorder_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to reorder table.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to release table.', default=None ) arrival_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Arrival date of the reorder.', default=None ) qty_ordered: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Quantity ordered in the order.', default=None, ) qty_received: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), comment='Quantity received in the order.', default=None, ) conf_qty: Mapped[Optional[int]] = mapped_column( Integer, comment='Quantity confirmed in the order.', default=None ) class ReorderNew(Base): __tablename__ = 'reorder_new' __table_args__ = ( Index('conf_key', 'conf_key'), Index('vendor_id', 'vendor_id'), {'comment': 'Contains reorder information sent to labels.'}, ) reorder_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) order_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date of the order.', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) email: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Email address.', default=None ) email_sent: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the email is sent.', default=None, ) status: Mapped[Optional[str]] = mapped_column( ENUM('open', 'closed'), server_default=text("'open'"), comment='Status of the order. Value can be open or closed.', default=None, ) conf_key: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Confirmation key of the reorder.', default=None, ) conf_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Confirmation date of the reorder.', default=None ) conf_comment: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Confirmation comment of the reorder.', default=None, ) class ReportPreset(Base): __tablename__ = 'report_preset' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key identifying the report preset.', autoincrement=True, init=False, ) name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='User supplied name for the report preset.', ) report_id: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='id of the report the preset applies to.', ) params: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False, comment='JSON formatted param set to save as a report preset.', ) account_type: Mapped[str] = mapped_column( ENUM('vendor', 'subaccount'), nullable=False, comment='Grass header Grass-Account-Type.', ) account_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Grass header Grass-Account-Id.' ) user_id: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Grass header Orchard-User-Id.', ) datetime_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='The date and time the report preset was created.', ) is_deleted: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'0'"), comment='Indicates if the report preset has been deleted.', ) class ReportRecord(Base): __tablename__ = 'report_record' __table_args__ = ( Index('idx_report_id', 'report_id'), Index('idx_status', 'report_status'), Index( 'idx_uid_nf_periods', 'user_id', 'user_type', 'number_format', 'from_accounting_period_id', 'to_accounting_period_id', unique=True, ), Index('idx_user_id', 'user_id'), ) report_record_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) report_status: Mapped[str] = mapped_column( ENUM('queued', 'processing', 'built', 'error'), nullable=False ) parameters: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) user_type: Mapped[str] = mapped_column( ENUM('subaccount', 'label', 'distributor', 'oa'), nullable=False ) number_format: Mapped[str] = mapped_column(ENUM('us', 'europe'), nullable=False) title: Mapped[str] = mapped_column(String(64, 'utf8mb4_general_ci'), nullable=False) added_by: Mapped[str] = mapped_column( String(32, 'utf8mb4_general_ci'), nullable=False ) updated_by: Mapped[str] = mapped_column( String(32, 'utf8mb4_general_ci'), nullable=False ) retry_count: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'") ) file_path: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) file_size: Mapped[Optional[int]] = mapped_column(BIGINT, default=None) line_count: Mapped[Optional[int]] = mapped_column(BIGINT, default=None) report_handle: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), default=None ) report_type: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), default=None ) report_id: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), default=None ) report_status_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) date_status_changed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) from_accounting_period_id: Mapped[Optional[int]] = mapped_column( SMALLINT, default=None ) to_accounting_period_id: Mapped[Optional[int]] = mapped_column( SMALLINT, default=None ) class RevenuePlan(Base): __tablename__ = 'revenue_plan' __table_args__ = { 'comment': 'Ancillary table used for the revenue report in OA. It holds ' } id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) dms_master_master_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='For "All Other" it is 0', default=None ) region: Mapped[Optional[str]] = mapped_column( ENUM('us', 'eur', 'row'), server_default=text("'us'"), default=None ) year: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) month: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) total_type: Mapped[Optional[str]] = mapped_column( ENUM('download', 'stream', 'mobile'), default=None ) total: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 2), default=None ) class RfPublisherMapping(Base): __tablename__ = 'rf_publisher_mapping' oa_pub_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) publisher_oa: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) rf_pub_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) publisher_rf: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) class RightsAttributes(Base): __tablename__ = 'rights_attributes' id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) description: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) rights_attributes_suggestion_keywords: Mapped[ list['RightsAttributesSuggestionKeywords'] ] = relationship( 'RightsAttributesSuggestionKeywords', back_populates='rights_attribute', init=False, ) rights_attributes_suggestion_genre_subgenre_keywords: Mapped[ list['RightsAttributesSuggestionGenreSubgenreKeywords'] ] = relationship( 'RightsAttributesSuggestionGenreSubgenreKeywords', back_populates='rights_attribute', init=False, ) rights_attributes_suggestion_vendor_imprint_keywords: Mapped[ list['RightsAttributesSuggestionVendorImprintKeywords'] ] = relationship( 'RightsAttributesSuggestionVendorImprintKeywords', back_populates='rights_attribute', init=False, ) vendor_rights_attributes: Mapped[list['VendorRightsAttributes']] = relationship( 'VendorRightsAttributes', back_populates='rights_attribute', init=False ) rights_attributes_suggestion_vendor_subaccount_keywords: Mapped[ list['RightsAttributesSuggestionVendorSubaccountKeywords'] ] = relationship( 'RightsAttributesSuggestionVendorSubaccountKeywords', back_populates='rights_attribute', init=False, ) track_rights_attributes: Mapped[list['TrackRightsAttributes']] = relationship( 'TrackRightsAttributes', back_populates='rights_attribute', init=False ) track_rights_attributes_changelog: Mapped[ list['TrackRightsAttributesChangelog'] ] = relationship( 'TrackRightsAttributesChangelog', back_populates='rights_attribute', init=False ) track_rights_attributes_edits: Mapped[list['TrackRightsAttributesEdits']] = ( relationship( 'TrackRightsAttributesEdits', back_populates='rights_attribute', init=False ) ) class RingtoneLicensingRequest(Base): __tablename__ = 'ringtone_licensing_request' __table_args__ = ( Index('track_id', 'track_id'), {'comment': 'Stores licensing request for particular ringtones'}, ) request_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) track_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to track table.', ) requested_by: Mapped[Optional[str]] = mapped_column( ENUM('service', 'm&m', 'pm', 'label'), server_default=text("'service'"), comment="Whom this ringtone licensing is requested by. Value can be 'service', 'm&m', 'pm', or 'label'.", default=None, ) priority: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'1'"), comment='Priority number. Value can be 1,2,3,4.', default=None, ) date_requested: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the ringtone licensing is requested.', default=None, ) ringtone_status: Mapped[Optional[str]] = mapped_column( ENUM('to_be_cleared', 'cleared', 'denied'), server_default=text("'to_be_cleared'"), comment='Status of the ringtone.', default=None, ) class RingtoneOrder(Base): __tablename__ = 'ringtone_order' __table_args__ = ( Index('cut_only', 'cut_only'), Index('date', 'date'), Index('encoder_id', 'encoder_id'), Index('orchadmin_user_id', 'orchadmin_user_id'), Index('status', 'status'), {'comment': 'Stores ringtone orders'}, ) ringtone_order_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) priority: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Priority number. Value can be 1,2.', default=None ) dms_list: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='List of DMS that are tied to the ringtone order.', default=None, ) date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the ringtone order.', default=None ) status: Mapped[Optional[str]] = mapped_column( ENUM('open', 'closed'), server_default=text("'open'"), comment='Status of the ringtone order. Value can be open or closed.', default=None, ) cut_only: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the ringtone order is for cutting only.', default=None, ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this ringtone order.', default=None, ) clip_per_track: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Number of clips per track.', default=None ) order_spec: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detail order specification.', default=None, ) tracks: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Tracks that are associated with this ringtone order.', default=None, ) encoder_id: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'7'"), default=None ) archived: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) marketing_comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) processed: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'P', 'N'), server_default=text("'N'"), default=None ) clip_type: Mapped[Optional[str]] = mapped_column( ENUM('regular', 'full_length'), server_default=text("'regular'"), default=None ) class RingtoneOrderDetail(Base): __tablename__ = 'ringtone_order_detail' __table_args__ = ( Index('clip_id', 'clip_id'), Index('date_delivered', 'date_delivered'), Index('ringtone_order_id', 'ringtone_order_id'), {'comment': 'Stores ringtone order details'}, ) ringtone_order_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) ringtone_order_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to ringtone_order table.' ) clip_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track_clips table.' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date this entry is last updated.', ) date_cut: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Holds the date when the ringtone was cut.', ) date_encoded: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Holds the date when the ringtone was encoded.', ) date_delivered: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Holds the date when the encoded ringtone was delivered.', ) class RingtoneSolicitation(Base): __tablename__ = 'ringtone_solicitation' __table_args__ = ( Index('bundle_id', 'bundle_id'), Index('dms_customer_id', 'dms_customer_id'), Index('license_no', 'license_no'), Index('track_id', 'track_id'), {'comment': 'Stores solicitations recorded for particular ringtones'}, ) solicitation_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) date_solicited: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Date of the solicitation.', ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to track table.', ) license_no: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='License number.' ) bundle_id: Mapped[Optional[int]] = mapped_column( INTEGER, server_default=text("'0'"), comment='Foreign key to bundle table.', default=None, ) class RoyaltyCollection(Base): __tablename__ = 'royalty_collection' __table_args__ = ( Index('collection_society_id', 'collection_society_id'), Index('quarter', 'quarter'), Index('year', 'year'), {'comment': 'Accounting table contains statement information for royalty '}, ) statement_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) collection_society_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to collection_society table.', ) paid: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates if it is paid.', ) year: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Statement year.' ) quarter: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Statement quarter.', ) actual_statement_no: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Statement number.', default=None ) date: Mapped[Optional[datetime.date]] = mapped_column(NormalizedDate, default=None) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class RoyaltyCollectionContract(Base, CreateMixin): __tablename__ = 'royalty_collection_contract' __table_args__ = ( Index('vendor_id', 'vendor_id'), Index('vendor_type', 'vendor_type'), {'comment': 'DEPRECATED'}, ) rc_contract_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Territory', default=None ) commission: Mapped[Optional[float]] = mapped_column( Float, comment='Commission in percentage', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Vendor or oms client id', default=None ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), comment='Vendor or oms client', default=None ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Start date of the contract', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='End date of the contract', default=None ) closer: Mapped[Optional[int]] = mapped_column( Integer, comment='orchadmin user who close', default=None ) date_entered: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of this contract being entered', default=None ) contract_complete: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='whether contract is finalized', default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Orchadmin user who created this contract', default=None ) class RoyaltyCollectionDetail(Base): __tablename__ = 'royalty_collection_detail' __table_args__ = ( Index('statement_id', 'statement_id'), Index('track_unique_id', 'track_unique_id'), {'comment': 'Accounting table contains details about royalty collection s'}, ) statement_detail_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) statement_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) track_unique_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) isrc: Mapped[Optional[str]] = mapped_column( String(12, 'utf8mb4_general_ci'), default=None ) track_name: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) total: Mapped[Optional[float]] = mapped_column(Float, default=None) class RoyaltyCollectionErrors(Base): __tablename__ = 'royalty_collection_errors' __table_args__ = ( Index('collection_society_id', 'collection_society_id'), Index('date', 'date'), Index('period', 'year', 'quarter'), Index('track_unique_id', 'track_unique_id'), {'comment': 'Static accounting table contains list of errors encountered '}, ) statement_detail_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, server_default=text("'0'") ) quarter: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) collection_society_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date: Mapped[Optional[datetime.date]] = mapped_column(NormalizedDate, default=None) track_unique_id: Mapped[Optional[int]] = mapped_column(BIGINT, default=None) isrc: Mapped[Optional[str]] = mapped_column( String(12, 'utf8mb4_general_ci'), default=None ) track_name: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) total: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) fixed: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) processed: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) class RoyaltyCollectionExports(Base): __tablename__ = 'royalty_collection_exports' __table_args__ = ( Index('track_id', 'track_id'), {'comment': 'Holds history of track information exports sent to collectio'}, ) id: Mapped[int] = mapped_column( BigInteger, primary_key=True, comment='Primary key', autoincrement=True, init=False, ) last_export_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date at which export was created', default=None ) track_id: Mapped[Optional[int]] = mapped_column( BIGINT, comment='unique id from track table or oms_track table', default=None ) creator: Mapped[Optional[int]] = mapped_column( Integer, comment='Orchadmin user id', default=None ) export_type: Mapped[Optional[str]] = mapped_column( ENUM('ppl', 'sound_exchange'), comment='format of export', default=None ) track_type: Mapped[Optional[str]] = mapped_column( ENUM('oms_track', 'track'), comment='Whether the track is oms or non_oms track', default=None, ) class RoyaltyCollectionStagingReleases(Base): __tablename__ = 'royalty_collection_staging_releases' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(Integer, nullable=False) created_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) society: Mapped[Optional[str]] = mapped_column(ENUM('ppl', 'scpp'), default=None) contains_errors: Mapped[Optional[Any]] = mapped_column(BIT(1), default=None) class RoyaltyCollectionStagingReleasesErrors(Base): __tablename__ = 'royalty_collection_staging_releases_errors' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) staging_export_release_id: Mapped[int] = mapped_column(Integer, nullable=False) error_message: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) created_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) class ScppLabels(Base): __tablename__ = 'scpp_labels' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) scpp_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) label_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) label_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class Screenshot(Base): __tablename__ = 'screenshot' __table_args__ = ( Index('dms_customer_id', 'dms_customer_id'), Index('placement_id', 'placement_id'), Index('priority', 'priority'), Index('type', 'type', 'id'), {'comment': 'Stores screenshots for releases.'}, ) screenshot_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) type: Mapped[str] = mapped_column( ENUM('label', 'artist', 'release'), nullable=False, server_default=text("'release'"), comment="Type of screenshot. Value can be 'vendor', 'artist', or 'release'.", ) id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to vendor, aritst_info or releaese table depending on what the type is.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) placement_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to dms_placement table.' ) description: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Descriptive text of the screenshot.', ) priority: Mapped[str] = mapped_column( ENUM('1', '2'), nullable=False, server_default=text("'2'"), comment='Priority number of the screenshot. Value can be 1 or 2.', ) start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Start date of the screenshot.' ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='End date of the screenshot.', default=None ) image_link: Mapped[Optional[str]] = mapped_column( String(164, 'utf8mb4_general_ci'), comment='Image file name for the screenshot.', default=None, ) t_script_status = Table( 'script_status', Base.metadata, Column('id', Integer, nullable=False), Column('script_name', String(255, 'utf8mb4_general_ci'), nullable=False), Column('last_run', NormalizedDateTime, default=None), Index('id', 'id'), ) class ServiceTier(Base): __tablename__ = 'service_tier' __table_args__ = (Index('service_tier_unique_uuid', 'uuid', unique=True),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Service tier name', default=None ) uuid: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Service tier uuid', default=None ) display_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Service tier display name', default=None, ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='The date that Service tier was updated', default=None, ) vendor_service_tier: Mapped[list['VendorServiceTier']] = relationship( 'VendorServiceTier', back_populates='service_tier', init=False ) class ServiceType(Base): __tablename__ = 'service_type' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) service_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='The type of service' ) vendor_contract: Mapped[list['VendorContract']] = relationship( 'VendorContract', back_populates='service_type', init=False ) vendor_proposed_term: Mapped[list['VendorProposedTerm']] = relationship( 'VendorProposedTerm', back_populates='service_type', init=False ) class Sites(Base): __tablename__ = 'sites' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) url_definition: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) site_name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) site_category: Mapped[Optional[str]] = mapped_column( ENUM('social', 'ticket_seller', 'video'), default=None ) image_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) consumer_key: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) consumer_secret: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist_social_connections: Mapped[list['ArtistSocialConnections']] = relationship( 'ArtistSocialConnections', back_populates='site', init=False ) artist_url: Mapped[list['ArtistUrl']] = relationship( 'ArtistUrl', back_populates='site', init=False ) artist_videos: Mapped[list['ArtistVideos']] = relationship( 'ArtistVideos', back_populates='site', init=False ) social_references: Mapped[list['SocialReferences']] = relationship( 'SocialReferences', back_populates='site', init=False ) social_site_preferences: Mapped[list['SocialSitePreferences']] = relationship( 'SocialSitePreferences', back_populates='site', init=False ) tourdate_buylinks: Mapped[list['TourdateBuylinks']] = relationship( 'TourdateBuylinks', back_populates='site', init=False ) class SocialProfile(Base, CreateMixin): __tablename__ = 'social_profile' __table_args__ = ( Index('UC_SOCIAL_NETWORK', 'platform', 'platform_id', unique=True), ) social_profile_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) platform: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='e.g. "Facebook"' ) platform_name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='The name of the social profile on the social network, e.g. Taylor Swift', ) collection_scheduled_time: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False, comment='e.g. 00:05:00 to indicate this should be collected at 5 minutes past midnight every day.', ) platform_id: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='The platform id of social network e.g. For facebook the id of the artist is 123', default=None, ) last_collected_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='When record was last collected', default=None ) created_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='When record was created, in millisecond precision (e.g. 2016-12-15 16:47:51.000000)', default=None, ) updated_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='When record was created, in millisecond precision (e.g. 2016-12-15 16:47:51.000000)', default=None, ) updated_by: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='updated_by: alw:{user_id}', default=None, ) created_by: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), comment='created_by: alw:{user_id}', default=None, ) class SonyStatus(Base): __tablename__ = 'sony_status' __table_args__ = ( Index('date', 'date'), Index('result', 'upc', 'type', 'result'), Index('resultt', 'result'), Index('type', 'type'), Index('upc', 'upc'), {'comment': 'deprecated'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) provider: Mapped[Optional[str]] = mapped_column( ENUM('sony', 'ci', 'direct_delivery'), server_default=text("'sony'"), default=None, ) upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) date: Mapped[Optional[datetime.date]] = mapped_column(NormalizedDate, default=None) type: Mapped[Optional[str]] = mapped_column( ENUM( 'metadata', 'delivery', 'audio', 'image', 'PackageProblem', 'MetadataParseProblem', 'MetadataProblem', 'MediaProblem', 'SystemProblem', ), default=None, ) result: Mapped[Optional[str]] = mapped_column( ENUM( 'SUCCEEDED', 'FAILED', 'pending', 'complete', 'processing', 'stalled', 'problem', ), default=None, ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class SoundexchangeUpcs(Base): __tablename__ = 'soundexchange_upcs' __table_args__ = ( Index('delivery_id', 'delivery_id'), Index('upc_exists', 'upc_exists'), ) sx_upc: Mapped[int] = mapped_column(BIGINT, primary_key=True) delivery_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) upc_exists: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N', 'DH'), default=None ) class SoundscanGenreMappings(Base): __tablename__ = 'soundscan_genre_mappings' orchard_genre_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) soundscan_genre_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) class SoundscanGenres(Base, UpdateMixin): __tablename__ = 'soundscan_genres' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) genre: Mapped[str] = mapped_column(String(50, 'utf8mb4_general_ci'), nullable=False) genre_type: Mapped[str] = mapped_column(SET('upc', 'isrc'), nullable=False) orchard_country_id: Mapped[int] = mapped_column(Integer, nullable=False) created_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) is_core: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) description: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) class SoundscanProductFormatMappings(Base): __tablename__ = 'soundscan_product_format_mappings' soundscan_product_format_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'") ) orchard_release_format: Mapped[str] = mapped_column( String(16, 'utf8mb4_general_ci'), primary_key=True ) class SoundscanProductFormats(Base, UpdateMixin): __tablename__ = 'soundscan_product_formats' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) format_code: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) created_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) format_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) country_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) class SoundscanUpcExclusion(Base): __tablename__ = 'soundscan_upc_exclusion' upc: Mapped[int] = mapped_column(BIGINT, primary_key=True) class SpotifyEquityCheckspaid(Base): __tablename__ = 'spotify_equity_checkspaid' __table_args__ = ( Index('cut_date', 'cut_date'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds checks payable for Spotify payout'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date of this check entry.', ) cut_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date the check is cut.', ) cash_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date the check is cashed/deposited.', ) vendor_id: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) check_payable: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the person/organization the check is paid to.', default=None, ) check_no: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Check number.', default=None ) check_amt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount paid on the check.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) paidfor_type: Mapped[Optional[str]] = mapped_column( ENUM('spotify_equity'), comment='Enumerated field indicates the entry type for the line item.', default=None, ) paidfor_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) t_standout_track = Table( 'standout_track', Base.metadata, Column( 'release_id', Integer, comment='Foreign key to release_tmp table.', default=None ), Column('upc', BigInteger, comment='Foreign key to releases table.', default=None), Column( 'standout_tracks', String(15, 'utf8mb4_general_ci'), comment='Track numbers that are standout on the release.', default=None, ), Index('release_id', 'release_id'), Index('upc', 'upc'), comment='Holds standout tracks', ) class StatutoryRates(Base): __tablename__ = 'statutory_rates' __table_args__ = {'comment': 'Stores statutory rates for accounting use'} statutory_rate_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) start_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Start date of the statutory rate.', ) rate: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Rate value.' ) per_minute_rate: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Per minute rate value.', ) class Stopwords(Base): __tablename__ = 'stopwords' __table_args__ = { 'comment': 'Contains lists of common words that should be avoided while ' } stopword: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), primary_key=True ) class SubgenreOriginal(Base): __tablename__ = 'subgenre_original' __table_args__ = ( Index('genre_id', 'genre_id'), Index('orchard_id', 'orchard_id'), {'comment': 'Hold subgenres'}, ) name: Mapped[str] = mapped_column( String(32, 'utf8mb4_general_ci'), nullable=False, comment='Name of the subgenre.', ) id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) genre_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to genre table.' ) orchard_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Real primary key of subgenre.' ) class SyncAdminContract(Base, CreateMixin): __tablename__ = 'sync_admin_contract' __table_args__ = ( Index('vendor_id_vendor_type', 'vendor_id', 'vendor_type'), {'comment': 'DEPRECATED'}, ) sa_contract_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Territory', default=None ) commission: Mapped[Optional[float]] = mapped_column( Float, comment='Commission in percentage', default=None ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Start date of the contract', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='End date of the contract', default=None ) response_time: Mapped[Optional[int]] = mapped_column( Integer, comment='Response time in days', default=None ) type_of_deal: Mapped[Optional[str]] = mapped_column( ENUM('master_admin', 'master_or_publishing_admin', 'publishing_admin_only'), comment='Type of deal', default=None, ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Vendor or Oms client id', default=None ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), comment='Vendor or Oms Client', default=None ) closer: Mapped[Optional[int]] = mapped_column( Integer, comment='Orchadmin user who close', default=None ) date_entered: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date on which contract is entered', default=None ) contract_complete: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='whether the contract is finalized', default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Orchadmin user who created this contract', default=None ) class SyncCheckspaid(Base): __tablename__ = 'sync_checkspaid' __table_args__ = ( Index('receipient_id', 'recepient_type', 'recepient_id'), Index('track_id', 'track_type', 'track_id'), {'comment': 'Contains checks paid to third parties for sync use.'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) entry_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date the checkspaid entry was created.', default=None, ) check_payable: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Checks payable.', default=None ) check_no: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='The check # for the check.', default=None, ) check_amt: Mapped[Optional[float]] = mapped_column( Float, comment='The amount of the check.', default=None ) cut_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the check was cut.', default=None ) cash_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date when the check was cashed.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comments regarding the check.', default=None, ) recepient_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'partner', 'third_party', 'oms_client'), comment='Indicates the parent table for the recepeint_id.', default=None, ) recepient_id: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key for the recepien't table.", default=None ) invoice_detail_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key for sync_invoice_detail table.', default=None ) track_type: Mapped[Optional[str]] = mapped_column( ENUM('track', 'oms_track'), comment='Indicates the type of track for which the synchronization fees are paid.', default=None, ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to track or oms_track table.', default=None ) entered_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Indicates the user that entered the checkspaid.', default=None, ) class SyncInvoice(Base, CreateMixin): __tablename__ = 'sync_invoice' __table_args__ = ( Index('oms_project_id', 'oms_project_id'), {'comment': 'Table contains invoice information related to sync uses.'}, ) invoice_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) oms_project_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to oms_project table. Links each invoice to a particular oms project.', default=None, ) invoice_for: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Field briefly describes the reason for the invoice.', default=None, ) invoice_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date of the invoice.', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date invoice was entered into the system.', default=None, ) invoice_to: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Recepient of the invoice.', default=None, ) address_1: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment="Recepient's Address line 1", default=None, ) address_2: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment="Recepient's address line 2", default=None, ) city: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment="Recepient's Address - City", default=None, ) zip: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment="Recepient's Address - Postal Code", default=None, ) state: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key to orchard_state table. Receipeint's Address - State.", default=None, ) other_state: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment="Recepient's Address - other state. Provided when the country is not US", default=None, ) country: Mapped[Optional[int]] = mapped_column( Integer, comment="Recepient's Address - Country", default=None ) email: Mapped[Optional[str]] = mapped_column( String(120, 'utf8mb4_general_ci'), comment="Recepient's email.", default=None ) paid: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the invoice is paid or not.', default=None, ) date_emailed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the invoice was emailed.', default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table indicates who created the invoice.', default=None, ) class SyncInvoiceDetail(Base): __tablename__ = 'sync_invoice_detail' __table_args__ = ( Index('invoice_id', 'invoice_id'), Index('track_id', 'track_type', 'track_id'), {'comment': 'Contains details related to sync invoice.'}, ) invoice_detail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) invoice_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to sync_invoice table.' ) track_type: Mapped[Optional[str]] = mapped_column( ENUM('track', 'oms_track'), server_default=text("'track'"), comment='Indicates the type of track for which the synchronization fees are paid.', default=None, ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to track or oms_track table.', default=None ) invoice_amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(4, 0), comment='Amount of the money original sent with the invoice.', default=None, ) received_amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(4, 0), comment='Amount of the money received.', default=None ) description: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='The description of the invoice detail.', default=None ) class SyncInvoiceDetailBreakdown(Base): __tablename__ = 'sync_invoice_detail_breakdown' __table_args__ = ( Index('invoice_detail_id', 'invoice_detail_id'), Index( 'invoice_detail_id_recepient', 'invoice_detail_id', 'recepient_type', 'recepient_id', unique=True, ), Index('recepient_id', 'recepient_id'), ) invoice_detail_breakdown_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) invoice_detail_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to sync_invoice_detail table.' ) recepient_type: Mapped[Optional[str]] = mapped_column( ENUM('label', 'partner', 'orchard', 'third_party'), server_default=text("'label'"), comment='Indicates the parent type for recepient_id', default=None, ) breakdown_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='The percentage of the sync_invoice_detail amount that belongs to the recepient.', default=None, ) recepient_id: Mapped[Optional[int]] = mapped_column( Integer, comment="Foreign key to the recepient's table as indicated by recepeint_type.", default=None, ) class Tag(Base): __tablename__ = 'tag' __table_args__ = ( Index('NewIndex1', 'tag', unique=True), {'comment': 'Holds list of tags.'}, ) tag_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Auto increment primary key.', autoincrement=True, init=False, ) tag: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Name of the tag.' ) track_tag: Mapped[list['TrackTag']] = relationship( 'TrackTag', back_populates='tag', init=False ) class Task(Base): __tablename__ = 'task' __table_args__ = ( Index('assigned_to', 'assigned_to'), Index('ticket_id', 'ticket_id'), {'comment': 'Contains tasks associated with each ticket.'}, ) task_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) ticket_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to ticket table.', ) predefined_task_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to predefined_task table.', default=None ) type_area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Type area of the task.', default=None ) open_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the task is opened.', default=None ) close_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the task is closed.', default=None ) required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the task is required.', default=None, ) assigned_to: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who this task is assigned to.', default=None, ) description: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Description of the task.', default=None, ) class Theme(Base): __tablename__ = 'theme' __table_args__ = {'comment': 'Themes for releases'} theme_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) theme: Mapped[str] = mapped_column( String(35, 'utf8mb4_general_ci'), nullable=False, comment='Theme name.' ) class Ticket(Base, CreateMixin): __tablename__ = 'ticket' __table_args__ = ( Index('assigned_to', 'assigned_to'), Index('closed_by', 'closed_by'), Index('created_by', 'created_by'), Index('issue_id', 'issue_id'), Index('type_id', 'type_id'), Index('user_id', 'user_id'), {'comment': 'Holds OA tickets'}, ) ticket_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) status: Mapped[str] = mapped_column( ENUM( 'new', 'not_assigned', 'open', 'processing', 'waiting_for_customer', 'reassign', 'close', ), nullable=False, server_default=text("'not_assigned'"), comment="Status of the ticket. Value can be 'new', 'not_assigned', 'open', 'processing', 'waiting_for_customer', 'reassign', or 'close'.", ) type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to ticket_type table.' ) public: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether the ticket is public.', ) severity: Mapped[Optional[str]] = mapped_column( ENUM('regular', 'elevated', 'extreme'), server_default=text("'regular'"), comment="Severity of the ticket. Value can be 'regular', 'elevated', or 'extreme'.", default=None, ) assigned_to: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) functional_area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Functional area of the ticket.', default=None, ) functional_sub_area: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Sub functional area of the ticket.', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'temp_vendor', 'visitor', 'customer', 'artist', 'release'), server_default=text("'visitor'"), comment="User type of the ticket. Value can be 'vendor', 'temp_vendor', 'visitor', 'customer', 'artist', or 'release'. Vendor assignment ticket is no longer used.", default=None, ) user_id: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Corresponding foreign key to the table that the user_type is referring to.', default=None, ) contact_name: Mapped[Optional[str]] = mapped_column( String(35, 'utf8mb4_general_ci'), comment='Contact name of the ticket.', default=None, ) contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Contact email address of the ticket.', default=None, ) contact_phone: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Contact phone number of the ticket.', default=None, ) open_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the ticket is opened.', default=None ) close_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the ticket is closed.', default=None ) closed_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who closed this ticket.', default=None, ) origin: Mapped[Optional[str]] = mapped_column( ENUM('phone', 'email', 'contact_us', 'members_area', 'internal'), comment="Origin of the ticket. Value can be 'phone', 'email', 'contact_us', 'members_area', or 'internal'.", default=None, ) subject: Mapped[Optional[str]] = mapped_column( String(150, 'utf8mb4_general_ci'), comment='Subject of the ticket.', default=None, ) issue_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to cs_issue table.', default=None ) estimated_time: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Estimated time for resolving the ticket.', default=None ) due_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Due date of the ticket.', default=None ) link: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='URL link where the ticket is originated.', default=None, ) created_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this ticket.', default=None, ) class TicketAssignment(Base): __tablename__ = 'ticket_assignment' __table_args__ = ( Index('assigned_by', 'assigned_by'), Index('assigned_to', 'assigned_to'), Index('ticket_id', 'ticket_id'), {'comment': 'Holds OA user ids of users to which this ticket is assigned '}, ) ticket_assignment_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) ticket_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to ticket table.', ) assigned_to: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_users. Stores the ID of the orchadmin user who is assigned to the ticket.', ) assigned_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users. Stores the ID of the orchadmin user who assigned the ticket.', default=None, ) date_assigned: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the ticket is assigned.', default=None ) t_ticket_task_notes = Table( 'ticket_task_notes', Base.metadata, Column('note_id', Integer, comment='Foreign key to note table.', default=None), Column('ticket_id', Integer, comment='Foreign key to ticket table.', default=None), Column( 'type', ENUM('customer', 'internal_public', 'internal_restricted'), comment="Type of task note. Value can be 'customer', 'internal_public', or 'internal_restricted'.", default=None, ), Column('task_id', Integer, comment='Foreign key to task table.', default=None), Index('note_id', 'note_id'), Index('task_id', 'task_id'), Index('ticket_id', 'ticket_id'), comment='Holds notes/comments related to tasks for tickets.', ) class TicketType(Base): __tablename__ = 'ticket_type' __table_args__ = {'comment': 'Holds ticket types'} type_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) type: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, comment='Ticket type name.' ) class Tier(Base): __tablename__ = 'tier' __table_args__ = {'comment': 'DEPRECATED'} tier_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) tier_name: Mapped[str] = mapped_column( String(30, 'utf8mb4_general_ci'), nullable=False, comment='Tier name.' ) class TierDms(Base): __tablename__ = 'tier_dms' __table_args__ = (Index('tier_id', 'tier_id'), {'comment': 'DEPRECATED'}) tier_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to tier table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) t_top_sellers_REMOVE = Table( 'top_sellers_REMOVE', Base.metadata, Column( 'id', String(60, 'utf8mb4_general_ci'), comment='Primary key.', default=None ), Column( 'id_type', ENUM('release', 'artist', 'label'), comment="Type of the ID. Value can be 'release', 'artist', or 'label'.", default=None, ), Column('sales', Float, comment='Sales amount.', default=None), comment='Holds top sellers for programming area', ) class TopTen(Base): __tablename__ = 'top_ten' id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='artist_id, upc, or track_id' ) type: Mapped[str] = mapped_column( ENUM('artist', 'release', 'track'), primary_key=True, server_default=text("'release'"), comment='type of item', ) total: Mapped[float] = mapped_column(Float, nullable=False, comment='total sales') date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='date added', ) class TrackClips(Base): __tablename__ = 'track_clips' __table_args__ = ( Index('upc', 'upc', 'cd', 'track_id', 'clip_number', unique=True), {'comment': 'Holds track clip information of tracks that are already in c'}, ) clip_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BigInteger, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ) cd: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='CD volume number of the track.' ) track_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Track number of the track.' ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Ring tone created date' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Ring tone modified date', ) clip_number: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Clip number of the clip.', default=None ) clip_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Clip title of the clip', default=None ) start_time: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Clip start time.', default=None ) end_time: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Clip end time.', default=None ) length: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Clip length.', default=None ) submitted_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Submitted user Id', default=None ) class TrackName(Base): __tablename__ = 'track_name' __table_args__ = ( Index('track_name', 'track_name'), {'comment': 'track_name from track table for name search'}, ) id: Mapped[int] = mapped_column(INTEGER, primary_key=True, comment='Primary key.') track_name: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Name/Title of the track.', default=None, ) class TrackNote(Base): __tablename__ = 'track_note' __table_args__ = ( Index('added_by', 'added_by'), Index('track_id', 'track_id'), {'comment': 'Hold track note information of tracks that are already in ca'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) note: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) added_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) class TrackPublisher(Base): __tablename__ = 'track_publisher' __table_args__ = ( Index('track_id', 'upc', 'cd', 'track_id'), Index('unique_track_id', 'unique_track_id'), {'comment': 'Hold track publisher information of tracks that are already '}, ) track_publisher_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) publisher_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the publisher.', default=None, ) ownership: Mapped[Optional[float]] = mapped_column( Float, comment='Total ownership controlled by the publisher.', default=None ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='UPC of the release. Serves as foreign key to releases table.', default=None, ) cd: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Volume # of the track.', default=None ) track_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Track number.', default=None ) unique_track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to track table.', default=None ) class TrackRestriction(Base): __tablename__ = 'track_restriction' __table_args__ = ( Index( 'upc_detail', 'upc', 'cd', 'track_id', 'restriction_type', 'territory_or_dms_id', unique=True, ), {'comment': 'deprecated'}, ) track_restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ) cd: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'"), comment='CD volume number of the track.', ) track_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Track number of the track.', ) restriction_type: Mapped[str] = mapped_column( ENUM('territory', 'carveout', 'master_carveout'), nullable=False, server_default=text("'territory'"), comment="Type of restriction. Value can be 'dms', 'dms_master' or 'territory'.", ) territory_or_dms_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master, customer_master_master or country table', ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Time when restriction was added.', default=None ) added_by: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='OA user ID for the user who added this restriction.', default=None, ) class TrackSplit(Base): __tablename__ = 'track_split' __table_args__ = (Index('vendorid_isrc_idx', 'vendor_id', 'isrc', unique=True),) track_split_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) isrc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), default=None ) track_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(4, 3), default=None ) track_unique_id: Mapped[Optional[int]] = mapped_column( Integer, comment='For display purpose only one track id of each ISRC is saved.\n But the track split is applied to the all instances of ISRC.', default=None, ) class TrackVideoClips(Base): __tablename__ = 'track_video_clips' __table_args__ = ( Index('asset_type', 'asset_type'), Index('track_id', 'track_id'), {'comment': 'Hold informtion of video clips that are in catalog'}, ) clip_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Video clips created date' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Video clips modified date', ) clip_number: Mapped[Optional[int]] = mapped_column(Integer, default=None) clip_title: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) length_minutes: Mapped[Optional[int]] = mapped_column(Integer, default=None) length_seconds: Mapped[Optional[int]] = mapped_column(Integer, default=None) asset_type: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to distribution_features', default=None ) aspect_ratio: Mapped[Optional[str]] = mapped_column( ENUM( '4:3', '16:9', '8:5', '5:3', '40:23', '20:11', '40:21', '4:2', '40:19', '20:9', '40:17', '5:2', '8:3', '20:7', ), default=None, ) keywords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) synopsis: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key to track_video', default=None ) submitted_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Submitted user Id', default=None ) class TrackVideoMarker(Base): __tablename__ = 'track_video_marker' __table_args__ = ( Index('NewIndex1', 'type'), Index('track_id', 'track_id'), {'comment': 'Holds video marker information of track that are already in '}, ) marker_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(Integer, nullable=False) location_REMOVE: Mapped[Optional[str]] = mapped_column( String(11, 'utf8mb4_general_ci'), comment='Format: XX:XX:XX:XX', default=None ) name_REMOVE: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) chapter_number: Mapped[Optional[int]] = mapped_column(Integer, default=None) chapter_name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) time: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) type: Mapped[Optional[str]] = mapped_column( ENUM('preview', 'chapter', 'advertisement', 'music_cue'), server_default=text("'preview'"), default=None, ) start_timecode: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) end_timecode: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) isrc: Mapped[Optional[str]] = mapped_column( String(12, 'utf8mb4_general_ci'), default=None ) usages: Mapped[Optional[str]] = mapped_column( ENUM('featured', 'background'), default=None ) cline: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) pline: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) artists: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) song_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) cue_number: Mapped[Optional[int]] = mapped_column(Integer, default=None) class TrackdownActivity(Base): __tablename__ = 'trackdown_activity' __table_args__ = ( Index('trackdown_user_id', 'trackdown_user_id'), Index('upc_cd_track_id', 'upc', 'cd', 'track_id'), {'comment': 'Holds stream / download activities in trackdown & OA.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) trackdown_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key referencing trackdown_user table' ) activity_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='datetime at which the last activity occurred', ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False, comment='UPC of a track') cd: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='volume of a track' ) track_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='track number of a track' ) activity_type: Mapped[Optional[str]] = mapped_column( ENUM('stream', 'download'), server_default=text("'stream'"), comment='indicate whether the activity is stream or download', default=None, ) client_ip: Mapped[Optional[int]] = mapped_column( INTEGER, comment='IP of the user machine which accessing trackdown', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'td', 'api', 'alw'), server_default=text("'td'"), comment='Indicate whether user is from orchadmin or trackdown', default=None, ) class TrackdownAdvanceReleaseUser(Base): __tablename__ = 'trackdown_advance_release_user' __table_args__ = {'comment': 'Maps trackdown users to advance release'} id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key referencing release table', default=None ) advance_release_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign Ket referencing orchadmin_uers table', default=None ) class TrackdownMediaAccess(Base): __tablename__ = 'trackdown_media_access' __table_args__ = ( Index('trackdown_user_id', 'trackdown_user_id'), {'comment': 'Contains validation information for streaming & downloading '}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing trackdown user table', default=None ) token: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='token for media access', default=None ) token_type: Mapped[Optional[str]] = mapped_column( ENUM('stream', 'download'), comment='enum field indicating the type of token such as for stream or download.', default=None, ) last_accessed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='date on which music is streamed/downloaded', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'td', 'alw', 'api'), server_default=text("'td'"), comment='Indicate whether the access is from orchadmin or trackdown pages', default=None, ) class TrackdownNewsletter(Base): __tablename__ = 'trackdown_newsletter' __table_args__ = ( Index('NewIndex1', 'playlist_id'), {'comment': 'Hold newsletters in trackdown'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Newsletter Name', default=None ) type: Mapped[Optional[str]] = mapped_column( ENUM( 'flashlight', 'sounds_like_this', 'just_delivered', 'top_shelf', 'release_schedule', 'metal', 'hip_hop', 'classical', 'daily_rind_uk', 'branded', ), comment='Newsletter type', default=None, ) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='URL to the newsletter', default=None ) date_created: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date created of the newsletter', default=None ) subject: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='In this issue text', default=None ) upcs: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='comma delimited upcs for getting cover art image. Max number of upcs should not exceed 10', default=None, ) playlist_id: Mapped[Optional[int]] = mapped_column( Integer, comment="'Foreign key to playlist table", default=None ) class TrackdownPermissions(Base): __tablename__ = 'trackdown_permissions' __table_args__ = {'comment': 'Holds permission informatin in trackdown'} id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) permission_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Permission name', default=None ) class TrackdownProposalAccess(Base): __tablename__ = 'trackdown_proposal_access' __table_args__ = ( Index( 'trackdown_user_proposal_id', 'trackdown_user_id', 'proposal_id', unique=True, ), {'comment': 'Holds trackdown users who are allowed to have access to cert'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing trackdown user table', default=None ) proposal_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing proposals table', default=None ) featured_proposal: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicate whether this is a featured proposal', default=None, ) class TrackdownReleaseUser(Base): __tablename__ = 'trackdown_release_user' __table_args__ = {'comment': 'Maps trackdown users to releases'} id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign Key referencing trackdown users', default=None ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Foreign Key referencing releases', default=None ) class TrackdownTags(Base): __tablename__ = 'trackdown_tags' __table_args__ = {'comment': 'Holds user defined tags for trackdown'} tag_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) tag: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), comment='Tag name ', default=None ) class TrackdownUserPermission(Base): __tablename__ = 'trackdown_user_permission' __table_args__ = ( Index( 'trackdown_user_permisssion_id', 'trackdown_user_id', 'permission_id', unique=True, ), {'comment': 'Holds user permission of accessing trackdown'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to bmat_users', default=None ) permission_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to bmat_access_permissions', default=None ) class TrackdownUserPlaylist(Base): __tablename__ = 'trackdown_user_playlist' __table_args__ = ( Index('NewIndex1', 'trackdown_user_id', 'playlist_id', unique=True), Index('playlist_id', 'playlist_id'), {'comment': 'Intermediary table for many to many relationship which links'}, ) user_playlist_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) trackdown_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing trackdown user table', default=None ) playlist_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing playlist table', default=None ) class TrackdownUserTag(Base): __tablename__ = 'trackdown_user_tag' __table_args__ = ( Index('tag_id', 'trackdown_user_id', 'tag_id', unique=True), Index('trackdown_user_id', 'trackdown_user_id'), {'comment': 'Intermediary table for many to many relationship which links'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) trackdown_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key referencing trackdown_user table' ) tag_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key referencing tag table.' ) class TrackdownUsers(Base): __tablename__ = 'trackdown_users' __table_args__ = ( Index('NewIndex1', 'featured_playlist_id'), Index('NewIndex2', 'login', unique=True), Index('orchard_contact', 'orchard_contact'), {'comment': 'Holds trackdown users information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) name: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='full name of this trackdown user', ) login: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='login of this trackdown user', ) password: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='password of this trackdown user', ) company: Mapped[str] = mapped_column( String(115, 'utf8mb4_general_ci'), nullable=False, comment='company of this trackdown user', ) email: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='email of this trackdown user', ) phone: Mapped[str] = mapped_column( String(15, 'utf8mb4_general_ci'), nullable=False, comment='phone of this trackdown user', ) active: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'Y'"), comment='indicate whether this trackdown user is active', ) date_added: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='date on which this trackdown user is added', ) agreed: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'N'"), comment='When trackdown user logins the first time, there is an agreement page. This field indictates whether this trackdown user has clicked the agree button after reading the agreement. ', ) logo_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='url of the logo of this trackdown user', default=None, ) role_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='(Deprecated) we are using tag for trackdown user', default=None, ) orchard_contact: Mapped[Optional[int]] = mapped_column( INTEGER, comment='orchadmin user id of the OA user to whom this trackdown user can contact', default=None, ) featured_playlist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='foreign key to playlist table', default=None ) orchard_contact_phone: Mapped[Optional[str]] = mapped_column( String(15, 'utf8mb4_general_ci'), comment='Contact phone of this trackdown user', default=None, ) orchard_contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Email of this trackdown user', default=None, ) class TransferedReleases(Base): __tablename__ = 'transfered_releases' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) action: Mapped[Optional[str]] = mapped_column( ENUM('added', 'corrected'), server_default=text("'added'"), default=None ) class Travelex(Base, UpdateMixin): __tablename__ = 'travelex' __table_args__ = { 'comment': 'Travelex Global Business Payments Identifier per Vendor for ' } vendor_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) enrollment_id: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the publishers_checkspaid record.', default=None, ) class UiAccounttype(Base): __tablename__ = 'ui_accounttype' __table_args__ = (Index('ui_account_name_index', 'accounttype_name', unique=True),) ui_accounttype_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) accounttype_name: Mapped[str] = mapped_column( String(25, 'utf8mb4_bin'), nullable=False, comment='User type' ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='auto populated', ) description: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_bin'), comment='Description of account type for developer reference only', default=None, ) ui_restrictions: Mapped[list['UiRestrictions']] = relationship( 'UiRestrictions', back_populates='ui_accounttype', init=False ) class UniqueArtist(Base): __tablename__ = 'unique_artist' __table_args__ = (Index('rai_id', 'rai_id'),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) rai_id: Mapped[int] = mapped_column(INTEGER, nullable=False, comment='Exactuals ID') name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the artist', default=None ) itunes_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='iTunes ID', default=None ) amg_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='AMG ID', default=None ) artist_info: Mapped[list['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='unique_artist', init=False ) class Upcs(Base): __tablename__ = 'upcs' __table_args__ = ( Index('NewIndex1', 'status'), {'comment': 'Holds Predefined UPCS for UPC generation'}, ) upc: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='unique UPC. It will be retrieved only by "generate upc" button or backend scripts. Users not able to edit/add/delete this anywhere', ) status: Mapped[str] = mapped_column( ENUM('used', 'unused', 'claimed'), nullable=False, server_default=text("'unused'"), comment='status of the upc. It can be unused, used or claimed. Upc with used status will not be retrieved for assignment of new releases. Only unused or claimed over 12 hours will be retrieved', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) class VectorapiAccessTokens(Base): __tablename__ = 'vectorapi_access_tokens' oauth_token: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), primary_key=True ) client_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) user_id: Mapped[int] = mapped_column(INTEGER, nullable=False) user_type: Mapped[str] = mapped_column( ENUM('alw', 'oa'), nullable=False, server_default=text("'alw'") ) expires_REMOVE: Mapped[int] = mapped_column(Integer, nullable=False) class VectorapiAuthCodes(Base): __tablename__ = 'vectorapi_auth_codes' code: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), primary_key=True ) client_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) redirect_uri: Mapped[str] = mapped_column( String(200, 'utf8mb4_general_ci'), nullable=False ) expires: Mapped[int] = mapped_column(Integer, nullable=False) user_type: Mapped[str] = mapped_column( ENUM('alw', 'oa'), nullable=False, server_default=text("'alw'") ) user_id: Mapped[int] = mapped_column(INTEGER, nullable=False) is_used: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'0'"), comment='If not used, 0. Else, 1.', ) class VectorapiClients(Base): __tablename__ = 'vectorapi_clients' client_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), primary_key=True ) client_secret: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False ) redirect_uri: Mapped[str] = mapped_column( String(200, 'utf8mb4_general_ci'), nullable=False ) class VectorapiRefreshTokens(Base): __tablename__ = 'vectorapi_refresh_tokens' refresh_token: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), primary_key=True ) client_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False ) user_id: Mapped[int] = mapped_column(INTEGER, nullable=False) user_type: Mapped[str] = mapped_column( ENUM('alw', 'oa'), nullable=False, server_default=text("'alw'") ) expires: Mapped[int] = mapped_column(Integer, nullable=False) class VectorapiUser(Base): __tablename__ = 'vectorapi_user' user_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) api_key: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) api_secret: Mapped[Optional[str]] = mapped_column(VARCHAR(255), default=None) vectorapi_user_auth: Mapped[list['VectorapiUserAuth']] = relationship( 'VectorapiUserAuth', back_populates='user', init=False ) class VendorAccounting(Base): __tablename__ = 'vendor_accounting' __table_args__ = ( Index('unique_constraint', 'period_id', 'entry_type', 'vendor_id', unique=True), Index('vendor_id', 'vendor_id'), {'comment': 'Holds label accounting information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreing key to vendor table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='The total amount for the line item.' ) entry_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='The entry type for line item.', ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class VendorAccountingFlat(Base): __tablename__ = 'vendor_accounting_flat' __table_args__ = ( Index('period_id', 'period_id'), Index('vendor_id', 'vendor_id', 'period_id', unique=True), { 'comment': 'Flattened view of vendor_accounting. This will be ' 'populated/re-populated for a given vendor during the Generate ' 'Check Payables process.' }, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table' ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) advance_payment: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) advance_recouped: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) amount_payable: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) balance_forward: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) carried_over_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) digital_checkspaid: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_actual_net: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_adjusted_gross: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_amount_payable: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_balance_forward: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_carried_over_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_distribution_fees: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_gross: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_net_receipt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_outstanding_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_partner_share: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dig_recoupe: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) dpd_publishing: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) fx_spread_fee: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) label_balance_forward: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) label_checkspaid: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) label_outstanding_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) manual_adjustment: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) manual_adjustment_checkspaid: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) man_adj_outstanding_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) oms_fees: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) opening_manual_adjustment: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) outstanding_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) physical_checkspaid: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_actual_net: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_amount_payable: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_balance_forward: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_carried_over_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_cost: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_distribution_fees: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_gross: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_liquidation: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_net_receipt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_outstanding_balance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_partner_share: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_recoupe: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_reserves: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) phy_return: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) recoupable_advance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) ringtone_publishing: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) cloud_publishing: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) server_fixation_fees: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) total_checkspaid: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) unrecouped_advance: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) class VendorAccountingOld(Base): __tablename__ = 'vendor_accounting_old' __table_args__ = ( Index('unique_constraint', 'period_id', 'entry_type', 'vendor_id', unique=True), Index('vendor_id', 'vendor_id'), {'comment': 'Holds label accounting information'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreing key to vendor table.' ) year: Mapped[int] = mapped_column( SmallInteger, nullable=False, comment='The year where line item applies. This field together with quarter determines the period.', ) quarter: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='The quarter where line item applies. This field together with year determines the period.', ) amount: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='The total amount for the line item.' ) entry_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='The entry type for line item.', ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class VendorChargeback(Base, UpdateMixin): __tablename__ = 'vendor_chargeback' __table_args__ = { 'comment': 'This accounting table holds charge-back information related ' } id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BigInteger, nullable=False, comment='UPC of the release. Serves as foreign key to releases table.', ) chargeback_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date of the chargeback.', default=None ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='The amount of the chargeback.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='The description of the chargeback.', default=None, ) label_approval_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date label approved the chargeback.', default=None ) supervisor_approval_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='The date supervisor approved the chargeback.', default=None, ) effective_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='The year of accounting period when the chargeback will take effect.', default=None, ) effective_quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='The quarter of accounting period when the chargeback will take effect.', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the publishers_checkspaid record.', default=None, ) class VendorCheckspaid(Base, UpdateMixin): __tablename__ = 'vendor_checkspaid' __table_args__ = ( Index('cut_date', 'cut_date'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds vendor level check payable'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) entry_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date of this check entry.', ) cut_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Date the check is cut.', ) cash_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text("'0000-00-00 00:00:00'"), comment='Date the check is cashed/deposited.', ) vendor_id: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) check_payable: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the person/organization the check is paid to.', default=None, ) check_no: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Check number.', default=None ) check_amt: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount paid on the check.', default=None ) comments: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Comment text if any.', default=None ) paidfor_type: Mapped[Optional[str]] = mapped_column( ENUM('manual_adjustment', 'advance_recoupment'), comment='Enumerated field indicates the entry type for the line item.', default=None, ) paidfor_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the publishers_checkspaid record.', default=None, ) class VendorContractAdvance(Base): __tablename__ = 'vendor_contract_advance' __table_args__ = ( Index('contract_id', 'contract_id'), Index('currency_id', 'currency_id'), {'comment': 'Holds advanced payment information'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( Double(asdecimal=True), comment='Amount of adance.', default=None ) currency_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to currencies table.', default=None ) due_type: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Indicates how the advance is due.', default=None, ) date_paid: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the advance is paid.', default=None ) contract_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor_contract table.', default=None ) exchange_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Exchange Rate in decimal between 0 and 1', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Description textarea in Advance Payment(s) panel in vendor proposed term page', default=None, ) apply_to_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class VendorContractChangeHistory(Base): __tablename__ = 'vendor_contract_change_history' __table_args__ = ( Index('contract_id', 'contract_id'), {'comment': 'Holds change histories of contracts'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) contract_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor_proposed_term table.', default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table.', default=None ) date_changed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Datetime when the change(s) occurs.', default=None ) change_detail: Mapped[Optional[str]] = mapped_column( LONGTEXT, comment='Detailed description of the change(s).', default=None ) contract_type: Mapped[Optional[str]] = mapped_column( ENUM('distribution', 'publishing_admin', 'sync_admin', 'royalty_collection'), server_default=text("'distribution'"), comment='Indicates type of contract.', default=None, ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), server_default=text("'vendor'"), comment='Indicates if contract is for vendor or oms only client', default=None, ) class VendorContractRightsGranted(Base): __tablename__ = 'vendor_contract_rights_granted' __table_args__ = ( Index('contract_id', 'contract_id'), {'comment': 'Holds rights granted information in the corresponding label '}, ) contract_rights_granted_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) rights_granted: Mapped[Optional[str]] = mapped_column( String(150, 'utf8mb4_general_ci'), comment='Rights granted.', default=None ) contract_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor_contract table.', default=None ) class VendorDmsContract(Base): __tablename__ = 'vendor_dms_contract' __table_args__ = ( Index('contract_id', 'contract_id'), Index('vendor_id', 'vendor_id', 'dms_customer_id', 'contract_id', unique=True), {'comment': 'Label contract table holds DMS substore specific rates as de'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to vendor table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) dms_split: Mapped[decimal.Decimal] = mapped_column( DECIMAL(6, 3), nullable=False, server_default=text("'0.000'"), comment='DMS split percentage number.', ) contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_contract table.' ) class VendorDmsMasterContract(Base): __tablename__ = 'vendor_dms_master_contract' __table_args__ = ( Index('fk_vendor_dms_master_contract_customer_master_master1', 'dms_master_id'), Index('fk_vendor_dms_master_contract_vendor1', 'vendor_id'), Index('fk_vendor_dms_master_contract_vendor_contract1', 'vendor_contract_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Vendor's contract id" ) dms_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Customer Master Master' ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False, comment='Vendor ID') dms_master_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(4, 3), comment='dms_master split', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class VendorDmsMasterRestriction(Base): __tablename__ = 'vendor_dms_master_restriction' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('distribution_type_id', 'distribution_type_id'), Index( 'vendor_restriction', 'vendor_contract_id', 'customer_master_master_id', 'distribution_type_id', unique=True, ), {'comment': 'Holds master store restrictions'}, ) restriction_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='Primary key', autoincrement=True, init=False ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master_master table' ) distribution_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to distribution_type table' ) vendor_contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_contract table' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) updated_by: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to orchadmin_users table', default=None ) class VendorEmailNotification(Base): __tablename__ = 'vendor_email_notification' __table_args__ = ( Index( 'vend_contact_email_notification', 'vend_contact_id', 'email_notification_id', ), {'comment': 'Holds label email notifications'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id_REMOVE: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing vendor table', default=None ) email_notification_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key referencing email notification table', default=None, ) vend_contact_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key references vend_contact table.', default=None ) class VendorMessage(Base): __tablename__ = 'vendor_message' __table_args__ = ( Index('message_id', 'message_id'), Index('vendor_id', 'vendor_id', 'message_id', unique=True), {'comment': 'Links vendor and message table.'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Auto increment primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor tagle.', default=None ) message_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to message table.', default=None ) unread: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'Y'"), comment='Indicates whether or not message is read by vendor.', default=None, ) class VendorNotes(Base): __tablename__ = 'vendor_notes' __table_args__ = ( Index('note_id', 'note_id'), Index('vendor_id', 'vendor_id'), {'comment': 'Relationship table between vendor and note tables'}, ) note_id: Mapped[int] = mapped_column( Integer, primary_key=True, server_default=text("'0'"), comment='Foreign key to note table.', ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) class VendorPaymentIntervalHistory(Base): __tablename__ = 'vendor_payment_interval_history' __table_args__ = (Index('vendor_period', 'vendor_id', 'period_id', unique=True),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) payment_interval: Mapped[str] = mapped_column( ENUM('month', 'quarter'), nullable=False, server_default=text("'quarter'") ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class VendorPaymentIntervalHistoryOld(Base): __tablename__ = 'vendor_payment_interval_history_old' __table_args__ = (Index('vendor_period', 'vendor_id', 'period_id', unique=True),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) payment_interval: Mapped[str] = mapped_column( ENUM('month', 'quarter'), nullable=False, server_default=text("'quarter'") ) period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) class VendorPrivilege(Base): __tablename__ = 'vendor_privilege' id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) privilege: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Privilege name', default=None ) vendor_permissions: Mapped[list['VendorPermissions']] = relationship( 'VendorPermissions', back_populates='privilege', init=False ) class VendorProposedContractAdvance(Base): __tablename__ = 'vendor_proposed_contract_advance' __table_args__ = ( Index('contract_id', 'vendor_proposed_term_id'), Index('currency_id', 'currency_id'), {'comment': 'Holds advanced payment information for proposed terms'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) amount: Mapped[Optional[float]] = mapped_column( Float, comment='Amount of adance.', default=None ) currency_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to currencies table.', default=None ) exchange_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Exchange Rate in decimal between 0 and 1', default=None ) due_type: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Indicates how the advance is due.', default=None, ) date_paid: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the advance is paid.', default=None ) vendor_proposed_term_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor_proposed_term table.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Description on advance payment', default=None, ) class VendorProposedDmsContract(Base): __tablename__ = 'vendor_proposed_dms_contract' __table_args__ = ( Index( 'vendor_id', 'vendor_id', 'dms_customer_id', 'vendor_proposed_term_id', unique=True, ), {'comment': 'Proposed label contract table holds DMS substore specific ra'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to vendor table.', ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, server_default=text("'0'"), comment='Foreign key to customer_master table.', ) dms_split: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='DMS split percentage number.', ) vendor_proposed_term_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_proposed_term table.' ) class VendorProposedDmsMasterContract(Base): __tablename__ = 'vendor_proposed_dms_master_contract' __table_args__ = ( Index('fk_vendor_proposed_dms_master_contract_cmm1', 'dms_master_id'), Index('fk_vendor_proposed_dms_master_contract_vendor1', 'vendor_id'), Index( 'fk_vendor_proposed_dms_master_contract_vendor_contract1', 'vendor_proposed_term_id', ), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_proposed_term_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Vendor's contract id" ) dms_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Customer Master Master' ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False, comment='Vendor ID') dms_master_split: Mapped[Optional[float]] = mapped_column( Float, comment='Dms Master split', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class VendorProposedDmsMasterRestriction(Base): __tablename__ = 'vendor_proposed_dms_master_restriction' __table_args__ = ( Index('customer_master_master_id', 'customer_master_master_id'), Index('distribution_type_id', 'distribution_type_id'), Index('vendor_proposed_term_id', 'vendor_proposed_term_id'), {'comment': 'Holds master store restriction information for proposed term'}, ) restriction_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master_master table' ) distribution_type_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to distribution_type table' ) vendor_proposed_term_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_contract table' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Last update timestamp', default=None ) updated_by: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to orchadmin_users table', default=None ) class VendorProposedRecoupContract(Base): __tablename__ = 'vendor_proposed_recoup_contract' __table_args__ = ( Index('contract_id', 'vendor_proposed_term_id'), {'comment': 'Holds special recoupment promotion information of proposed t'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) vendor_proposed_term_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to vendor_proposed_term table.', ) recoup_fees: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Recoup fee number.' ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Description on proposed recoup contract', default=None, ) class VendorProposedTermChangeHistory(Base): __tablename__ = 'vendor_proposed_term_change_history' __table_args__ = ( Index('orchadmin_user_id', 'orchadmin_user_id'), Index('vendor_proposed_term_id', 'vendor_proposed_term_id'), {'comment': 'Holds change histories of all proposed terms'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) vendor_proposed_term_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) orchadmin_user_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table.', default=None ) date_changed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Datetime when the change(s) occurs.', default=None ) change_detail: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Detailed description of the change(s).', default=None ) rejected_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_rejected: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) reason_of_rejection: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) approved_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_approved: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class VendorProposedTermDistributionType(Base): __tablename__ = 'vendor_proposed_term_distribution_type' __table_args__ = {'comment': 'Holds distribution type of propoosed terms'} id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_proposed_term_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) distribution_type_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Reference to distribution_type table.', default=None ) new_store_default: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) class VendorProposedTerritoryContract(Base): __tablename__ = 'vendor_proposed_territory_contract' __table_args__ = ( Index('fk_vendor_proposed_territory_contract_country1', 'country_id'), Index('fk_vendor_proposed_territory_contract_vendor1', 'vendor_id'), Index( 'fk_vendor_proposed_territory_contract_vendor_contract1', 'vendor_proposed_term_id', ), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_proposed_term_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Vendor's contract id" ) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False, comment='Country') vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False, comment='Vendor ID') territory_split: Mapped[Optional[float]] = mapped_column( Float, comment='territory split', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class VendorRecoupContract(Base): __tablename__ = 'vendor_recoup_contract' __table_args__ = ( Index('contract_id', 'contract_id'), {'comment': 'Holds special recoupment promotion information for contract'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) contract_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'"), comment='Foreign key to vendor_contract table.', ) start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Start date of the label recoup contract.', ) end_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, server_default=text("'0000-00-00'"), comment='Start date of the label recoup contract.', ) recoup_fees: Mapped[float] = mapped_column( Float, nullable=False, server_default=text("'0'"), comment='Recoup fee number.' ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Description of recoup contract', default=None, ) class VendorResource(Base): __tablename__ = 'vendor_resource' id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) resource: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Resource Name', default=None ) vendor_permissions: Mapped[list['VendorPermissions']] = relationship( 'VendorPermissions', back_populates='resource', init=False ) class VendorRolePermissions(Base): __tablename__ = 'vendor_role_permissions' __table_args__ = ( Index('FK_vendor_role_permissions_permission_id', 'permission_id'), Index('FK_vendor_role_permissions_role_id', 'role_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) role_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_roles id' ) permission_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_permission table' ) allow: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Access control logic', ) class VendorRoles(Base): __tablename__ = 'vendor_roles' id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) role: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Role name', default=None ) vend_contact_roles: Mapped[list['VendContactRoles']] = relationship( 'VendContactRoles', back_populates='role', init=False ) vend_contact_roles_restored: Mapped[list['VendContactRolesRestored']] = ( relationship('VendContactRolesRestored', back_populates='role', init=False) ) class VendorSyncRevenue(Base): __tablename__ = 'vendor_sync_revenue' __table_args__ = ( Index('country_id', 'country_id'), Index('invoice_date', 'invoice_date'), Index('invoice_detail_id', 'invoice_detail_id'), Index('track_id', 'track_id'), {'comment': 'Accounting table holds amount of sync revenue generated by l'}, ) vendor_sync_revenue_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) invoice_detail_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to sync_invoice_detail table', default=None ) client_name: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Client name from the OMS project', default=None, ) track_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to track table', default=None ) country_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to country table', default=None ) invoice_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of the invoice', default=None ) revenue: Mapped[Optional[float]] = mapped_column( Float, comment='Total revenue', default=None ) class VendorTerritoryContract(Base): __tablename__ = 'vendor_territory_contract' __table_args__ = ( Index('fk_vendor_territory_contract_country1', 'country_id'), Index('fk_vendor_territory_contract_vendor1', 'vendor_id'), Index('fk_vendor_territory_contract_vendor_contract1', 'vendor_contract_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Vendor's contract id" ) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False, comment='Country') vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False, comment='Vendor ID') territory_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(4, 3), comment='territory split', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) t_vendor_tmp_notes = Table( 'vendor_tmp_notes', Base.metadata, Column('vendor_id', Integer, comment='Foreign key to vendor table.', default=None), Column('note_id', Integer, comment='Foreign key to note table.', default=None), Index('note_id', 'note_id'), Index('vendor_id', 'vendor_id'), comment='DEPRECATED', ) class VendorTransactionTypeContract(Base): __tablename__ = 'vendor_transaction_type_contract' __table_args__ = (Index('vendor_contract_id_idx', 'vendor_contract_id'),) vendor_transaction_type_contract_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column(INTEGER, nullable=False) vendor_id: Mapped[int] = mapped_column(Integer, nullable=False) transaction_type: Mapped[Optional[str]] = mapped_column( String(2, 'utf8mb4_general_ci'), default=None ) transaction_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(5, 4), default=None ) class VendorTtTerritoryContract(Base): __tablename__ = 'vendor_tt_territory_contract' __table_args__ = (Index('vendor_contract_id_idx', 'vendor_contract_id'),) vendor_tt_territory_contract_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column(INTEGER, nullable=False) vendor_id: Mapped[int] = mapped_column(Integer, nullable=False) transaction_type: Mapped[Optional[str]] = mapped_column( String(2, 'utf8mb4_general_ci'), default=None ) territory_id: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) territory_transaction_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(5, 4), default=None ) class Venue(Base): __tablename__ = 'venue' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) venue_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) address: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) city: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) state_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) other_state: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) country: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) phone: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) website: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) latitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), default=None ) longitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), default=None ) class VideoAssetType(Base): __tablename__ = 'video_asset_type' video_asset_type_id: Mapped[int] = mapped_column(Integer, primary_key=True) video_asset_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) video_asset: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) class VideoDashboardNotifications(Base): __tablename__ = 'video_dashboard_notifications' notification_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) dashboard_item_id: Mapped[int] = mapped_column(Integer, nullable=False) notification_type_id: Mapped[int] = mapped_column(Integer, nullable=False) notify_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class VideoDashboardStatus(Base): __tablename__ = 'video_dashboard_status' status_type_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) status_type: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) video_dashboard_item: Mapped[list['VideoDashboardItem']] = relationship( 'VideoDashboardItem', back_populates='status_type', init=False ) video_dashboard_item_status: Mapped[list['VideoDashboardItemStatus']] = ( relationship( 'VideoDashboardItemStatus', back_populates='status_type', init=False ) ) t_youtube_audit_log = Table( 'youtube_audit_log', Base.metadata, Column('youtube_audit_id', INTEGER, nullable=False), Column('vendor_id', INTEGER, nullable=False), Column('report_location', String(255, 'utf8mb4_general_ci'), default=None), Column('initiated_by_id', INTEGER, default=None), Column( 'audit_status', ENUM('requested', 'in_progress', 'generating', 'complete', 'error'), default=None, ), Column('updated_timestamp', NormalizedDateTime, default=None), Index('IDX_yt_audit_id', 'youtube_audit_id'), Index('IDX_yt_audit_log_status', 'report_location'), Index('IDX_yt_audit_log_vendor_id', 'vendor_id'), ) class YoutubeChannel(Base): __tablename__ = 'youtube_channel' __table_args__ = ( ForeignKeyConstraint( ['account_manager'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_account_manager', ), ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_artist', ), ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_country', ), ForeignKeyConstraint( ['language_code'], ['language.language_code'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_vendor', ), ForeignKeyConstraint( ['youtube_channel_asset_type_id'], ['youtube_channel_asset_types.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_asset_type', ), ForeignKeyConstraint( ['youtube_channel_cms_account_history_id'], ['youtube_channel_cms_account_history.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_cms_account_history', ), Index('FK_youtube_channel', 'language_code'), Index('FK_youtube_channel_artist', 'artist_id'), Index('FK_youtube_channel_asset_type', 'youtube_channel_asset_type_id'), Index('FK_youtube_channel_category', 'youtube_channel_category_id'), Index( 'FK_youtube_channel_cms_account_history', 'youtube_channel_cms_account_history_id', ), Index('FK_youtube_channel_country', 'country_id'), Index('FK_youtube_channel_mcn_coordinator', 'account_manager'), Index( 'FK_youtube_channel_partner_status', 'youtube_channel_partner_status_history_id', ), Index( 'FK_youtube_channel_service_tier_history', 'youtube_channel_service_tier_history_id', ), Index('FK_youtube_channel_vendor', 'vendor_id'), Index('index_youtube_channel_id', 'youtube_channel_id'), Index('uniqueChannelName', 'youtube_channel_name', unique=True), Index('uniqueYoutubeChannelId', 'youtube_channel_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) artist_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key of artist_info table.' ) date_initiated: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Initial date for channel.' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Always update time when someone tries to update data.', ) youtube_channel_id: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Youtube Channel id, from youtube. NOT THE PK', ) content_id_matching: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'1'"), comment='Enable or disable UGC matching for Content ID on YouTube', ) youtube_channel_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Youtube channel name may be left empty', default=None, ) youtube_channel_partner_status_history_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_partner_status_history table.', default=None, ) youtube_channel_category_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_category table.', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of vendor table.', default=None ) country_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key of country table.', default=None ) language_code: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) youtube_channel_service_tier_history_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_service_tier_history table.', default=None, ) monetization_status: Mapped[Optional[str]] = mapped_column( ENUM('pending', 'monetizing', 'not monetizing'), server_default=text("'pending'"), comment='Monetization status. Pending is by default.', default=None, ) date_connected: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Connection date for youtube channel.', default=None ) notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive notes.', default=None ) auto_claim: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), server_default=text("'no'"), comment='On/Off switch for claiming.', default=None, ) account_manager: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) youtube_channel_cms_account_history_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_cms_account_history table', default=None, ) youtube_channel_asset_type_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_asset_types table', default=None, ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='youtube_channel', init=False ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='youtube_channel', init=False ) country: Mapped[Optional['Country']] = relationship( 'Country', back_populates='youtube_channel', init=False ) language: Mapped[Optional['Language']] = relationship( 'Language', back_populates='youtube_channel', init=False ) vendor: Mapped[Optional['Vendor']] = relationship( 'Vendor', back_populates='youtube_channel', init=False ) youtube_channel_asset_type: Mapped[Optional['YoutubeChannelAssetTypes']] = ( relationship( 'YoutubeChannelAssetTypes', back_populates='youtube_channel', init=False ) ) youtube_channel_cms_account_history: Mapped[ Optional['YoutubeChannelCmsAccountHistory'] ] = relationship( 'YoutubeChannelCmsAccountHistory', foreign_keys=[youtube_channel_cms_account_history_id], back_populates='youtube_channel', init=False, ) youtube_channel_cms_account_history_: Mapped[ list['YoutubeChannelCmsAccountHistory'] ] = relationship( 'YoutubeChannelCmsAccountHistory', foreign_keys='[YoutubeChannelCmsAccountHistory.youtube_channel_id]', back_populates='youtube_channel_', init=False, ) youtube_channel_partner_status_history: Mapped[ list['YoutubeChannelPartnerStatusHistory'] ] = relationship( 'YoutubeChannelPartnerStatusHistory', back_populates='youtube_channel', init=False, ) youtube_channel_service_tier_history: Mapped[ list['YoutubeChannelServiceTierHistory'] ] = relationship( 'YoutubeChannelServiceTierHistory', back_populates='youtube_channel', init=False ) youtube_channel_upc: Mapped[list['YoutubeChannelUpc']] = relationship( 'YoutubeChannelUpc', back_populates='youtube_channel', init=False ) youtube_channel_video_status: Mapped[list['YoutubeChannelVideoStatus']] = ( relationship( 'YoutubeChannelVideoStatus', back_populates='youtube_channel', init=False ) ) class YoutubeChannelAccessToken(Base): __tablename__ = 'youtube_channel_access_token' __table_args__ = (Index('Unique_date_inserted', 'date_inserted', unique=True),) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) access_token: Mapped[str] = mapped_column( String(10000, 'utf8mb4_general_ci'), nullable=False ) date_inserted: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) class YoutubeChannelActivitiesQScriptLog(Base): __tablename__ = 'youtube_channel_activities_q_script_log' __table_args__ = ( Index('scriptEndTime', 'scriptEndTime'), Index('writtenToActivitiesQ', 'writtenToActivitiesQ'), {'comment': 'Used as a log to record the kickoff of youtube automation runs.'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, autoincrement=True, init=False ) scriptStartTime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) scriptEndTime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) publishedAfter: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The publishedAfter timestamp written to the Activities Q.', default=None, ) writtenToActivitiesQ: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), server_default=text("'no'"), comment='Did the script successfully write to the Q', default=None, ) class YoutubeChannelAssetTypes(Base): __tablename__ = 'youtube_channel_asset_types' __table_args__ = ( Index( 'youtube_channel_asset_type_unique', 'youtube_channel_asset_type', unique=True, ), {'comment': 'Use to store different asset types'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) youtube_channel_asset_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Youtube asset type.' ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='youtube_channel_asset_type', init=False ) class YoutubeChannelCategory(Base): __tablename__ = 'youtube_channel_category' __table_args__ = ( Index( 'youtube_channel_category_name_unique', 'youtube_channel_category_name', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) youtube_channel_category_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Youtube category name.', ) class YoutubeChannelCmsAccount(Base): __tablename__ = 'youtube_channel_cms_account' __table_args__ = ( Index('uniqueCMSAContentOwner', 'cmsa_content_owner', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) cmsa_display_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='CMS Account Display Name as it appears in YouTube', ) cmsa_content_owner: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='Lowercase account string used in onBehalfOfContentOwner calls', ) enabled_for_claiming: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) enabled_for_audit: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive notes.', default=None ) content_owner_id: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='CMS account ID used by YouTube', default=None, ) youtube_channel_cms_account_history: Mapped[ list['YoutubeChannelCmsAccountHistory'] ] = relationship( 'YoutubeChannelCmsAccountHistory', back_populates='youtube_channel_cms_account', init=False, ) youtube_audit_release: Mapped[list['YoutubeAuditRelease']] = relationship( 'YoutubeAuditRelease', back_populates='asset_cms_account', init=False ) class YoutubeChannelCmsAccountHistory(Base): __tablename__ = 'youtube_channel_cms_account_history' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_users_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_cms_account_history_orchadmin_users', ), ForeignKeyConstraint( ['youtube_channel_cms_account_id'], ['youtube_channel_cms_account.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_cms_account', ), ForeignKeyConstraint( ['youtube_channel_id'], ['youtube_channel.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_cms_account_history_channel', ), Index('FK_youtube_channel_cms_account', 'youtube_channel_cms_account_id'), Index('FK_youtube_channel_cms_account_history_channel', 'youtube_channel_id'), Index( 'FK_youtube_channel_cms_account_history_orchadmin_users', 'orchadmin_users_id', ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) youtube_channel_cms_account_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_cms_account table.', default=None, ) youtube_channel_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel table.', default=None ) orchadmin_users_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of orchadmin_users table.', default=None ) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', foreign_keys='[YoutubeChannel.youtube_channel_cms_account_history_id]', back_populates='youtube_channel_cms_account_history', init=False, ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='youtube_channel_cms_account_history', init=False, ) youtube_channel_cms_account: Mapped[Optional['YoutubeChannelCmsAccount']] = ( relationship( 'YoutubeChannelCmsAccount', back_populates='youtube_channel_cms_account_history', init=False, ) ) youtube_channel_: Mapped[Optional['YoutubeChannel']] = relationship( 'YoutubeChannel', foreign_keys=[youtube_channel_id], back_populates='youtube_channel_cms_account_history_', init=False, ) class YoutubeChannelManuallySubmittedVideoIds(Base): __tablename__ = 'youtube_channel_manually_submitted_video_ids' __table_args__ = ( Index('ind_youtube_video_id', 'submitted_youtube_video_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) submitted_youtube_video_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment='A user submitted string which is hopefully a youtube video Id', ) cmsa_content_owner: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='Lowercase account string used in onBehalfOfContentOwner calls', ) class YoutubeChannelPartnerStatus(Base): __tablename__ = 'youtube_channel_partner_status' id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) youtube_channel_partner_status_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Youtube partner status name.', ) youtube_channel_partner_status_history: Mapped[ list['YoutubeChannelPartnerStatusHistory'] ] = relationship( 'YoutubeChannelPartnerStatusHistory', back_populates='youtube_channel_partner_status', init=False, ) class YoutubeChannelServiceTier(Base): __tablename__ = 'youtube_channel_service_tier' __table_args__ = ( Index( 'youtube_channel_service_tier_name', 'youtube_channel_service_tier_name', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) youtube_channel_service_tier_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Youtube service tier name.', ) youtube_channel_service_tier_history: Mapped[ list['YoutubeChannelServiceTierHistory'] ] = relationship( 'YoutubeChannelServiceTierHistory', back_populates='youtube_channel_service_tier', init=False, ) class YoutubeChannelVideoCategory(Base): __tablename__ = 'youtube_channel_video_category' id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) title: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) track_video: Mapped[list['TrackVideo']] = relationship( 'TrackVideo', back_populates='youtube_channel_video_category', init=False ) class YoutubeChannelVideoRemoveDuplicates(Base): __tablename__ = 'youtube_channel_video_remove_duplicates' __table_args__ = ( Index('ind_from_queue', 'from_queue'), Index('youtube_video_id', 'youtube_video_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) orchard_youtube_channel_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='FK to youtube_channel.id' ) youtube_video_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment="youtube's unique video Id", ) youtube_channel_id: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment="youtube's unique channel Id", ) from_queue: Mapped[str] = mapped_column( ENUM('Yes', 'No'), nullable=False, server_default=text("'No'"), comment='flag to tell us whether the videoId is already in the videoQ or not', ) onbehalfofcontentowner: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='stores CMSA information', default=None, ) youtube_channel_asset_type: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) class YoutubeChannelVideoStatusDeleted(Base): __tablename__ = 'youtube_channel_video_status_deleted' __table_args__ = ( Index('FK_youtube_video_status_channel_id', 'youtube_channel_id'), Index('FK_youtube_video_status_release_id', 'release_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) youtube_video_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment='Unique youtube video id', ) youtube_channel_id: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Fkey to youtube_channel table for youtubes channel id', ) in_processing: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='video is being processed in a Q and doesnt need added again to first queue', ) video_search_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time that we inserted the youtube_video_id to table', default=None, ) release_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='FKey to releases table', default=None ) track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Fkey to track table', default=None ) track_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed creating track through vapi', default=None, ) youtube_asset_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='unique youtube asset id', default=None, ) asset_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube insert asset api call', default=None, ) ownership_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube ownership api call', default=None, ) youtube_claim_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Unique youtube claim id', default=None, ) claim_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube claim api call', default=None, ) asset_match_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube asset match api call', default=None, ) youtube_reference_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='unique youtube reference id', default=None, ) reference_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube reference api call', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='when this row was last updated', default=None, ) error_type: Mapped[Optional[str]] = mapped_column( ENUM( 'already_claimed_error', 'short_for_reference_error', 'vapi_error', 'video_processing_error', 'reference_exist_error', 'other_error', 'reached_max_attempts', 'video_not_owned', ), default=None, ) inserted_datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='When the row was inserted into this table', default=None, ) class YoutubeReportGenerationLog(Base): __tablename__ = 'youtube_report_generation_log' request_report_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) search_params: Mapped[str] = mapped_column(MEDIUMTEXT, nullable=False) report_status: Mapped[str] = mapped_column( ENUM('queued', 'generating', 'complete', 'error'), nullable=False ) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) report_type: Mapped[Optional[str]] = mapped_column( ENUM('Asset', 'Claim/UGC'), default=None ) user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) label_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) file_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) file_path: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) class Agreement(Base): __tablename__ = 'agreement' __table_args__ = ( ForeignKeyConstraint( ['currencies_id'], ['currencies.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_agreement_currencies_id', ), Index('FK_agreement_currencies_id', 'currencies_id'), Index('closer', 'closer'), Index('currency_id', 'currency_id'), Index('service_id', 'service_id'), {'comment': 'Holds agreement information with DMS, Label and Owner/Aggreg'}, ) agreement_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) service_name: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Name of the service. Service type is determined by service_type column.', default=None, ) service_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='System ID for the corresponding service. It can be DMS ID, Label ID or Partner ID.', default=None, ) service_type: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Type of service. It can be one of these three - DMS, Label and Partner.', default=None, ) payee: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), comment='Payee name.', default=None ) orchard_dba: Mapped[Optional[str]] = mapped_column( ENUM('orchard', 'oms', 'ogmg', 'orchard_gmg', 'od', 'orchard_oms'), comment='Orchard Doing Business As', default=None, ) action: Mapped[Optional[str]] = mapped_column( ENUM('new_agreement', 'addendum', 'replacement_agreement'), comment='The action of agreement entry indicating whether it is a new agreement, an addendum to old one, etc..', default=None, ) currency_id: Mapped[Optional[str]] = mapped_column( String(3, 'utf8mb4_general_ci'), comment='Foreign Key to currency table.', default=None, ) agreement_type: Mapped[Optional[str]] = mapped_column( ENUM('content_in', 'dmsp', 'miscellaneous', 'mobile', 'territorial'), comment='Type of agreement.', default=None, ) entry_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the agreement was created', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The last update timestamp for the agreement.', default=None, ) entered_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Orchard user who enters in this agreement.', default=None ) auto_renewal: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates if this agreement has auto renewal.', default=None, ) auto_renewal_term: Mapped[Optional[int]] = mapped_column( Integer, comment='Stores the frequency of auto renewal if this agreement has auto renewal.', default=None, ) auto_renewal_term_rollover: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates if the auto renewal should roll over once it expires.', default=None, ) terminate_upon_notice: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Yes or No indicates if termination of this agreement will be upon notice.', default=None, ) terminate_upon_notice_period: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The period for the termination notice.', default=None, ) effective_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Agreement is effective as of this date.', default=None ) initial_expiration_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Agreement expires as of this initial date.', default=None, ) tax_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Tax ID of payee.', default=None ) tax_exempt: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Yes or No indicates if the payee is tax exempt.', default=None, ) closer: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Orchard user who is the closer of the agreement.', default=None, ) contact_first_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='contact_first_name', default=None ) contact_last_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='contact_last_name', default=None ) contact_email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='contact_email', default=None ) address_street: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), comment='address_street', default=None ) address_city: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='address_city', default=None ) address_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='address_state', default=None ) address_zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='address_zip', default=None ) contact_fax: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='contact_fax', default=None ) contact_phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='contact_phone', default=None ) company: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='company', default=None ) address2: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='address2', default=None ) orchard_country: Mapped[Optional[int]] = mapped_column( INTEGER, comment='orchard_country', default=None ) address_other_state: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='address_other_state', default=None ) currencies_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign Key to currencies table', default=None ) currencies: Mapped[Optional['Currencies']] = relationship( 'Currencies', back_populates='agreement', init=False ) class AgreementRevenueRate(Base): __tablename__ = 'agreement_revenue_rate' __table_args__ = ( ForeignKeyConstraint( ['currencies_id'], ['currencies.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_agreement_revenue_rate_currencies_id', ), Index('FK_agreement_revenue_rate_currencies_id', 'currencies_id'), Index('agreement_id', 'agreement_id'), {'comment': 'Hold revenue rate information with particular agreements'}, ) agreement_revenue_rate_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) download_type: Mapped[Optional[str]] = mapped_column( ENUM( 'permanent_ala_carte', 'subscription', 'full_length_download', 'mastertone', 'ringback', ), comment="Type of download. Can be one of 'permanent_ala_carte','subscription','full_length_download','mastertone','ringback'.", default=None, ) album_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Rate for album download.', default=None ) track_rate: Mapped[Optional[float]] = mapped_column( Float, comment='Rate for track download.', default=None ) agreement_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to agreement table.', default=None ) currency_id: Mapped[Optional[str]] = mapped_column( String(3, 'utf8mb4_general_ci'), comment='Foreign key to currency table.', default=None, ) currencies_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign Key to currencies table.', default=None ) currencies: Mapped[Optional['Currencies']] = relationship( 'Currencies', back_populates='agreement_revenue_rate', init=False ) class ApiPermissions(Base): __tablename__ = 'api_permissions' __table_args__ = ( ForeignKeyConstraint( ['api_privilege_id'], ['api_privilege.api_privilege_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_permissions_privileges', ), ForeignKeyConstraint( ['api_resource_id'], ['api_resources.api_resource_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_permissions_resources', ), Index('FK_api_permissions_privileges', 'api_privilege_id'), Index('FK_api_permissions_resources', 'api_resource_id'), ) api_permission_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_resource_id: Mapped[int] = mapped_column(Integer, nullable=False) api_privilege_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) api_privilege: Mapped[Optional['ApiPrivilege']] = relationship( 'ApiPrivilege', back_populates='api_permissions', init=False ) api_resource: Mapped['ApiResources'] = relationship( 'ApiResources', back_populates='api_permissions', init=False ) api_role_permissions: Mapped[list['ApiRolePermissions']] = relationship( 'ApiRolePermissions', back_populates='api_permission', init=False ) class ApiProductRequiredRoles(Base): __tablename__ = 'api_product_required_roles' __table_args__ = ( ForeignKeyConstraint( ['api_role_id'], ['api_roles.api_role_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_product_required_roles_roles', ), Index('FK_api_product_required_roles_roles', 'api_role_id'), Index('api_product_version_id', 'api_product_version_id', 'api_role_id'), ) api_product_req_role_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_product_version_id: Mapped[int] = mapped_column(Integer, nullable=False) api_role_id: Mapped[int] = mapped_column(Integer, nullable=False) api_role: Mapped['ApiRoles'] = relationship( 'ApiRoles', back_populates='api_product_required_roles', init=False ) class ApiProductVersionRevenueModel(Base): __tablename__ = 'api_product_version_revenue_model' __table_args__ = ( ForeignKeyConstraint( ['model_id'], ['api_revenue_model.model_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_product_version_revenue_model_id', ), Index('FK_api_product_version_revenue_model_id', 'model_id'), Index( 'FK_api_product_version_revenue_model_version_id', 'api_product_version_id' ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) model_id: Mapped[int] = mapped_column(INTEGER, nullable=False) api_product_version_id: Mapped[int] = mapped_column(Integer, nullable=False) model: Mapped['ApiRevenueModel'] = relationship( 'ApiRevenueModel', back_populates='api_product_version_revenue_model', init=False, ) class ArtistCarveoutTemplate(Base): __tablename__ = 'artist_carveout_template' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], name='fk_artist_carveout_template_country', ), ForeignKeyConstraint( ['country_id'], ['country.id'], name='fk_artist_carveout_template_artist' ), Index('fk_artist_carveout_template_artist_idx', 'country_id'), Index('idx_artist_carveout_template_artist_id', 'artist_id'), ) artist_carveout_template_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_carveout_template', init=False ) country: Mapped['Country'] = relationship( 'Country', back_populates='artist_carveout_template', init=False ) class ArtistCustomEvents(Base): __tablename__ = 'artist_custom_events' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_info', ), ForeignKeyConstraint( ['category_id'], ['artist_custom_event_categories.category_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_custom_event_category_id', ), Index('FK_artist_custom_event_category_id', 'category_id'), Index('FK_artist_info', 'artist_id'), Index('IDX_event_date', 'event_date'), ) event_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) event_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) event_date: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) category_id: Mapped[int] = mapped_column(Integer, nullable=False) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_custom_events', init=False ) category: Mapped['ArtistCustomEventCategories'] = relationship( 'ArtistCustomEventCategories', back_populates='artist_custom_events', init=False ) class ArtistInfoProfileCompletion(Base): __tablename__ = 'artist_info_profile_completion' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='CASCADE', onupdate='RESTRICT', name='artist_info_ibfk_1', ), ForeignKeyConstraint( ['section_id'], ['artist_info_profile_sections.section_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='artist_info_profile_sections_ibfk_1', ), Index('artist_info_ibfk_1', 'artist_id'), Index('artist_info_profile_sections_ibfk_1', 'section_id'), {'comment': 'table to track artist info completion'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key', autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='foreign key to artist_info table' ) section_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='foreign key to artist_info_profile_section table', ) completed_percentage: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='a value between 0 - 100' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='date the artist profile information was last updated.', default=None, ) total_completed: Mapped[Optional[int]] = mapped_column(Integer, default=None) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_info_profile_completion', init=False ) section: Mapped['ArtistInfoProfileSections'] = relationship( 'ArtistInfoProfileSections', back_populates='artist_info_profile_completion', init=False, ) class ArtistMarketableEvents(Base): __tablename__ = 'artist_marketable_events' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_marketable_events', ), Index('FK_artist_marketable_events', 'artist_id'), ) event_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) event_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) event_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) display_crosshair: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) crosshair_color: Mapped[Optional[str]] = mapped_column( String(7, 'utf8mb4_general_ci'), server_default=text("'#ff0000'"), default=None ) artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='artist_marketable_events', init=False ) class ArtistPress(Base): __tablename__ = 'artist_press' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_artist_press_artist_id', ), Index('FK_artist_press_artist_id', 'artist_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to artist_info table', default=None ) blurb: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Blurb', default=None ) link_text: Mapped[Optional[str]] = mapped_column( String(150, 'utf8mb4_general_ci'), comment='Link text', default=None ) link: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Link URL', default=None ) source: Mapped[Optional[str]] = mapped_column( String(150, 'utf8mb4_general_ci'), comment='Press source', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='artist_press', init=False ) class ArtistSocialConnections(Base): __tablename__ = 'artist_social_connections' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], name='FK_artist_social_connections_artist', ), ForeignKeyConstraint( ['site_id'], ['sites.id'], name='FK_artist_social_connections_site' ), Index('FK_ artist_url_access_tokens_artist', 'artist_id'), Index('FK_ artist_url_access_tokens_sites', 'site_id'), Index('FK_artist_social_connections_artist', 'artist_id'), Index('FK_artist_social_connections_site', 'site_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) site_id: Mapped[int] = mapped_column(INTEGER, nullable=False) connected: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) access_token: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) access_secret: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) scope: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) time_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_social_connections', init=False ) site: Mapped['Sites'] = relationship( 'Sites', back_populates='artist_social_connections', init=False ) artist_social_connection_preferences: Mapped[ list['ArtistSocialConnectionPreferences'] ] = relationship( 'ArtistSocialConnectionPreferences', back_populates='social_connection', init=False, ) social_publish_queue: Mapped[list['SocialPublishQueue']] = relationship( 'SocialPublishQueue', back_populates='artist_social_connection', init=False ) class ArtistUrl(Base): __tablename__ = 'artist_url' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_artist_url_info', ), ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_url', ), ForeignKeyConstraint( ['site_id'], ['sites.id'], ondelete='RESTRICT', onupdate='CASCADE', name='FK_artist_url_sites', ), Index('FK_artist_url_sites', 'site_id'), Index('artist_id', 'artist_id'), {'comment': 'Holds URLs for artists'}, ) url_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to artist_info table' ) site_id: Mapped[int] = mapped_column(INTEGER, nullable=False) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='URL', default=None ) social_profile_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='FK to social_profile table', default=None ) evaluated_for_collection: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'0'"), comment='Flag that let us know if the artist_url has been evaluated for collection', default=None, ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', foreign_keys=[artist_id], back_populates='artist_url', init=False ) artist_: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', foreign_keys=[artist_id], back_populates='artist_url_', init=False ) site: Mapped['Sites'] = relationship( 'Sites', back_populates='artist_url', init=False ) youtube_channel_verify: Mapped[list['YoutubeChannelVerify']] = relationship( 'YoutubeChannelVerify', back_populates='url', init=False ) class ArtistVideos(Base): __tablename__ = 'artist_videos' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_artist_videos_artist_info', ), ForeignKeyConstraint( ['site_id'], ['sites.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_videos_site', ), Index('FK_artist_videos_artist_info', 'artist_id'), Index('FK_artist_videos_site', 'site_id'), ) artist_video_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) link: Mapped[str] = mapped_column(String(255, 'utf8mb4_general_ci'), nullable=False) artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) title: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) image_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) site_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='artist_videos', init=False ) site: Mapped[Optional['Sites']] = relationship( 'Sites', back_populates='artist_videos', init=False ) class ArtistYtDeliverySettings(Base): __tablename__ = 'artist_yt_delivery_settings' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_yt_delivery_settings_artist_id', ), Index('FK_artist_yt_delivery_settings_artist_id', 'artist_id'), Index('artist_id', 'artist_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) artist_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to artist_info table.' ) channel_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Youtube/vevo channel name.', ) vevo_controlled: Mapped[str] = mapped_column( ENUM('No', 'Yes'), nullable=False, server_default=text("'No'"), comment='No/Yes to specify if it is VEVO controlled.', ) yt_channel_type: Mapped[str] = mapped_column( ENUM('name', 'id'), nullable=False, server_default=text("'name'"), comment='Defines the Channel Type used in the channel_name column.', ) video_match_policy: Mapped[Optional[str]] = mapped_column( ENUM('monetize', 'block', 'track'), server_default=text("'monetize'"), comment='Video match policy that should apply to the youtube video', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='When this row was last updated.', default=None, ) channel_id: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='YouTube Channel ID', default=None ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_yt_delivery_settings', init=False ) class AudioAttributesSuggestionKeywords(Base): __tablename__ = 'audio_attributes_suggestion_keywords' __table_args__ = ( ForeignKeyConstraint( ['audio_attribute_id'], ['audio_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_aa_keywords_audio_attribute_id', ), Index( 'UC_Audio_Attribute_Keyword', 'audio_attribute_id', 'keyword', unique=True ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) audio_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) keyword: Mapped[str] = mapped_column(VARCHAR(256), nullable=False) audio_attribute: Mapped['AudioAttributes'] = relationship( 'AudioAttributes', back_populates='audio_attributes_suggestion_keywords', init=False, ) class BlacklistReasons(Base): __tablename__ = 'blacklist_reasons' __table_args__ = ( ForeignKeyConstraint( ['added_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_blacklist_reason_added_by', ), Index('FK_blacklist_reason_added_by', 'added_by'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) added_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Logged in user who added blacklist word' ) reason: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_general_ci'), comment='Reason for which a word is blacklisted', default=None, ) alert: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) contact: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Record insertion date and time.', default=None ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Record update date and time.', default=None ) orchadmin_users: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='blacklist_reasons', init=False ) blacklist_words: Mapped[list['BlacklistWords']] = relationship( 'BlacklistWords', back_populates='blacklist_reason', init=False ) class CheckReceivableDetail(Base, UpdateMixin): __tablename__ = 'check_receivable_detail' __table_args__ = ( ForeignKeyConstraint( ['check_id'], ['check_receivable.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_check_id', ), Index('FK_check_id', 'check_id'), Index('customer_order_id', 'customer_order_id'), {'comment': 'Holds check receivable detail information for each check rec'}, ) check_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) check_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to check_receivable table.', ) type: Mapped[Optional[str]] = mapped_column( ENUM('credit', 'debit'), server_default=text("'credit'"), comment="Type of the check entry. Values can be 'credit' or 'debit'.", default=None, ) description: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Descriptive text of the check entry.', default=None, ) customer_order_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to customer_order table.', default=None ) total: Mapped[Optional[decimal.Decimal]] = mapped_column( Double(asdecimal=True), comment='Total amount to receive before discount.', default=None, ) discount: Mapped[Optional[decimal.Decimal]] = mapped_column( Double(asdecimal=True), comment='Discount amount.', default=None ) actual_total: Mapped[Optional[decimal.Decimal]] = mapped_column( Double(asdecimal=True), comment='Actual total amount received after discount.', default=None, ) year: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Year of this check paid for.', default=None ) month: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Month of this check paid for.', default=None ) paidfor: Mapped[Optional[str]] = mapped_column( ENUM('download', 'stream', 'oms', 'delivery', 'mobile', 'physical'), comment="Check paid for. Values can be 'download', 'stream', 'oms', 'delivery', 'mobile', or 'physical'.", default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the check_receivable_detail record.', default=None, ) check: Mapped['CheckReceivable'] = relationship( 'CheckReceivable', back_populates='check_receivable_detail', init=False ) class ClientNotificationDetail(Base): __tablename__ = 'client_notification_detail' __table_args__ = ( ForeignKeyConstraint( ['client_notification_url_id'], ['client_notification_url.client_notification_url_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_client_notification_detail_1', ), Index('FK_client_notification_detail_1', 'client_notification_url_id'), ) client_notification_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) retry_count: Mapped[int] = mapped_column(Integer, nullable=False) message: Mapped[Optional[str]] = mapped_column( String(15000, 'utf8mb4_general_ci'), default=None ) client_notification_url_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) date_notified: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) status: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) notification_type: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) client_notification_url: Mapped[Optional['ClientNotificationUrl']] = relationship( 'ClientNotificationUrl', back_populates='client_notification_detail', init=False ) class CompanyBrand(Base): __tablename__ = 'company_brand' __table_args__ = ( ForeignKeyConstraint( ['parent_company_id'], ['parent_company.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_company_brand_parent_company_id', ), Index('FK_company_brand_parent_company_id', 'parent_company_id'), Index('idx_company_brand_uuid', 'uuid'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Company brand name', default=None ) uuid: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Company brand uuid', default=None ) parent_company_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) display_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Company brand display name', default=None, ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='The date that company brand was updated', default=None, ) ddex_party_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) logo_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Company brand logo URL', default=None, ) parent_company: Mapped[Optional['ParentCompany']] = relationship( 'ParentCompany', back_populates='company_brand', init=False ) vendor: Mapped[list['Vendor']] = relationship( 'Vendor', back_populates='company_brand', init=False ) class CurrencyExchangeRates(Base): __tablename__ = 'currency_exchange_rates' __table_args__ = ( ForeignKeyConstraint( ['period_id'], ['period.period_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_currency_exchange_rates_period1', ), Index('fk_currency_exchange_rates_period1', 'period_id'), Index( 'uidx_period_from_to', 'period_id', 'currency_from_id', 'currency_to_id', unique=True, ), ) id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) period_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) currency_from_id: Mapped[Optional[int]] = mapped_column( SMALLINT, server_default=text("'0'"), default=None ) currency_to_id: Mapped[Optional[int]] = mapped_column( SMALLINT, server_default=text("'0'"), default=None ) exchange_rate: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) period: Mapped['Period'] = relationship( 'Period', back_populates='currency_exchange_rates', init=False ) class DistributionFormat(Base): __tablename__ = 'distribution_format' __table_args__ = ( ForeignKeyConstraint( ['distribution_format_media_format_id'], ['distribution_format_media_format.distribution_format_media_format_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_distribution_format_media_format_id', ), ForeignKeyConstraint( ['distribution_format_media_id'], ['distribution_format_media.distribution_format_media_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_distribution_format_media_id', ), Index( 'FK_distribution_format_media_format_id', 'distribution_format_media_format_id', ), Index('FK_distribution_format_media_id', 'distribution_format_media_id'), {'comment': 'Holds distribution format names'}, ) distribution_format_id: Mapped[int] = mapped_column( TINYINT, primary_key=True, autoincrement=True, init=False ) distribution_format_media_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) distribution_format_media_format_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) display_flag: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) context_type: Mapped[Optional[str]] = mapped_column( ENUM('physical', 'digital'), server_default=text("'physical'"), default=None ) distribution_format_media_format: Mapped[ Optional['DistributionFormatMediaFormat'] ] = relationship( 'DistributionFormatMediaFormat', back_populates='distribution_format', init=False, ) distribution_format_media: Mapped[Optional['DistributionFormatMedia']] = ( relationship( 'DistributionFormatMedia', back_populates='distribution_format', init=False ) ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='distribution_format', init=False ) class DmsMasterGenre(Base): __tablename__ = 'dms_master_genre' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], name='fk_dms_master_genre', ), Index('fk_dms_master_genre_idx', 'customer_master_master_id'), Index( 'unique_dmsmaster_genre', 'customer_master_master_id', 'dms_master_genre', unique=True, ), Index( 'unique_dmsmaster_genrename_genrecode', 'customer_master_master_id', 'dms_master_genre', 'genre_code', unique=True, ), ) dms_master_genre_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment="Foreign key refernce of 'customer_master_master' table.", ) dms_master_genre: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Dms genre name.' ) genre_code: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_master_genre', init=False ) dms_genre_mapping: Mapped[list['DmsGenreMapping']] = relationship( 'DmsGenreMapping', back_populates='dms_master_genre', init=False ) dms_master_subgenre: Mapped[list['DmsMasterSubgenre']] = relationship( 'DmsMasterSubgenre', back_populates='dms_master_genre', init=False ) class DmsMasterPricingSchemeTerritory(Base): __tablename__ = 'dms_master_pricing_scheme_territory' __table_args__ = ( ForeignKeyConstraint( ['pricing_scheme_id'], ['dms_master_pricing_scheme.pricing_scheme_id'], name='new_fk_dms_master_pricing_scheme_id', ), Index('customer_id', 'country_id'), Index('pricing_scheme_id', 'pricing_scheme_id'), {'comment': 'Links each DMS - territory to a pricing scheme'}, ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='primary key', autoincrement=True, init=False, ) pricing_scheme_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key referencing pricing scheme table' ) country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key referencing customer master table', ) currency_code: Mapped[Optional[str]] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), default=None ) pricing_scheme: Mapped['DmsMasterPricingScheme'] = relationship( 'DmsMasterPricingScheme', back_populates='dms_master_pricing_scheme_territory', init=False, ) class DmsPreferredArtistCountry(Base): __tablename__ = 'dms_preferred_artist_country' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_artist_country_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) artist_country_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_artist_country', init=False, ) class DmsPreferredGenre(Base): __tablename__ = 'dms_preferred_genre' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_genre_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) genre_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_genre', init=False ) class DmsPreferredLabel(Base): __tablename__ = 'dms_preferred_label' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_label_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) label_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_label', init=False ) class DmsPreferredLabelCountry(Base): __tablename__ = 'dms_preferred_label_country' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_label_country_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) label_country_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_label_country', init=False ) class DmsPreferredLabelPriority(Base): __tablename__ = 'dms_preferred_label_priority' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_label_priority_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) label_priority_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_label_priority', init=False, ) class DmsPreferredMarketingPriority(Base): __tablename__ = 'dms_preferred_marketing_priority' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_marketing_priority_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) marketing_priority_id: Mapped[str] = mapped_column( String(5, 'utf8mb4_general_ci'), primary_key=True ) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_marketing_priority', init=False, ) t_dms_preferred_meta_language = Table( 'dms_preferred_meta_language', Base.metadata, Column('customer_master_master_id', SMALLINT, primary_key=True), Column('language_code', String(8, 'utf8mb4_general_ci'), primary_key=True), ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_customer_master_master_id', ), ForeignKeyConstraint( ['language_code'], ['language.language_code'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_language_code', ), Index('FK_customer_master_master_id', 'customer_master_master_id'), Index('FK_language_code', 'language_code'), comment='Holds dms preferred meta language', ) class DmsPreferredSalesStartDate(Base): __tablename__ = 'dms_preferred_sales_start_date' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_release_year_cmm_id', ), Index('FK_dms_preferred_release_year_cmm_id', 'customer_master_master_id'), {'comment': 'Holds dms preferred release year'}, ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) start_date: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) class DmsPreferredSubaccount(Base): __tablename__ = 'dms_preferred_subaccount' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_subaccount_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) subaccount_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_subaccount', init=False ) class DmsPreferredSubgenre(Base): __tablename__ = 'dms_preferred_subgenre' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_preferred_subgenre_cmm_id', ), ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, primary_key=True) subgenre_id: Mapped[int] = mapped_column(Integer, primary_key=True) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_preferred_subgenre', init=False ) class DmsPricingTier(Base): __tablename__ = 'dms_pricing_tier' __table_args__ = ( ForeignKeyConstraint( ['pricing_scheme_id'], ['dms_master_pricing_scheme.pricing_scheme_id'], name='new_FK_dms_master_pricing_scheme', ), Index('new_FK_dms_master_pricing_scheme', 'pricing_scheme_id'), Index('pricing_scheme_id', 'pricing_scheme_id'), {'comment': 'Holds list of pricing tier for each pricing scheme.'}, ) pricing_tier_id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='primary key', autoincrement=True, init=False, ) pricing_scheme_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key referencing pricing scheme table' ) price_code: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, comment='price code' ) pricing_tier: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='pricing tier in pricing tiers panel on edit release page on both label copy and content page', ) pricing_scheme: Mapped['DmsMasterPricingScheme'] = relationship( 'DmsMasterPricingScheme', back_populates='dms_pricing_tier', init=False ) release_pricing_tier: Mapped[list['ReleasePricingTier']] = relationship( 'ReleasePricingTier', back_populates='pricing_tier', init=False ) track_pricing_tier: Mapped[list['TrackPricingTier']] = relationship( 'TrackPricingTier', back_populates='pricing_tier', init=False ) class DmsTerritoryCurrency(Base): __tablename__ = 'dms_territory_currency' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='new_FK_dms_territory_currency', ), Index( 'customer_country', 'country_id', 'customer_master_master_id', unique=True ), Index( 'customer_country_currency', 'customer_master_master_id', 'country_id', 'currency_code', unique=True, ), Index('new_FK_dms_territory_currency', 'customer_master_master_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) customer_master_master_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) currency_code: Mapped[str] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), nullable=False ) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_territory_currency', init=False ) class EmaillistmembersDelete(Base): __tablename__ = 'emaillistmembers_delete' __table_args__ = ( ForeignKeyConstraint( ['listid'], ['emaillist.listid'], ondelete='RESTRICT', onupdate='RESTRICT', name='emaillistmembers_delete_ibfk_1', ), Index('listid', 'listid'), ) memberid: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) firstname: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) lastname: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) email: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) createddate: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) createdby: Mapped[Optional[int]] = mapped_column(Integer, default=None) listid: Mapped[Optional[int]] = mapped_column(Integer, default=None) memstatus: Mapped[Optional[int]] = mapped_column(Integer, default=None) emaillist: Mapped[Optional['Emaillist']] = relationship( 'Emaillist', back_populates='emaillistmembers_delete', init=False ) class FilmGenreStoreMapping(Base): __tablename__ = 'film_genre_store_mapping' __table_args__ = ( ForeignKeyConstraint( ['film_genre_id'], ['film_genre.film_genre_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_film_genre_store_mapping', ), Index('FK_film_genre_store_mapping', 'film_genre_id'), ) film_genre_store_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) film_genre_id: Mapped[int] = mapped_column(Integer, nullable=False) store_id: Mapped[int] = mapped_column(Integer, nullable=False) store_genre: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) film_genre: Mapped['FilmGenre'] = relationship( 'FilmGenre', back_populates='film_genre_store_mapping', init=False ) class ImageAssets(Base): __tablename__ = 'image_assets' __table_args__ = ( ForeignKeyConstraint( ['category_id'], ['image_category.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='image_category_fk_constraint', ), Index('image_category_fk_constraint', 'category_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) category_id: Mapped[int] = mapped_column(Integer, nullable=False) path: Mapped[str] = mapped_column(String(100, 'utf8mb4_general_ci'), nullable=False) filename: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False ) mime_type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) file_size: Mapped[int] = mapped_column(Integer, nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) date_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) height: Mapped[Optional[int]] = mapped_column(Integer, default=None) width: Mapped[Optional[int]] = mapped_column(Integer, default=None) cdn_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) category: Mapped['ImageCategory'] = relationship( 'ImageCategory', back_populates='image_assets', init=False ) api_images: Mapped[list['ApiImages']] = relationship( 'ApiImages', back_populates='image_asset', init=False ) api_products_screenshots: Mapped[list['ApiProductsScreenshots']] = relationship( 'ApiProductsScreenshots', back_populates='image_asset', init=False ) message: Mapped[list['Message']] = relationship( 'Message', back_populates='image_asset', init=False ) vendor_icon: Mapped[list['VendorIcon']] = relationship( 'VendorIcon', back_populates='image_asset', init=False ) vendor_logo: Mapped[list['VendorLogo']] = relationship( 'VendorLogo', back_populates='image_asset', init=False ) class ImportAsset(Base): __tablename__ = 'import_asset' __table_args__ = ( ForeignKeyConstraint( ['import_asset_batch_id'], ['import_asset_batch.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_import_asset_batch_id', ), Index('FK_upload_request_batch_id', 'import_asset_batch_id'), Index('asset_type', 'asset_type'), Index('filename', 'filename'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key', autoincrement=True, init=False ) import_asset_batch_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='foreign key to upload_request id' ) filename: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='a particular file name inside an upload requested folder', ) asset_type: Mapped[str] = mapped_column( ENUM('audio', 'image', 'caption', 'subtitles'), nullable=False, comment='asset type for the particular file being uploaded', ) foldername: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='a particular folder name inside the upload request', default=None, ) STATUS: Mapped[Optional[str]] = mapped_column( ENUM('upload_complete', 'error', 'finished', 'new', 'deleted'), server_default=text("'new'"), comment='status result for the uploaded file', default=None, ) upload_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time the file processing for this uploaded file was completed', default=None, ) encoding_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time the file processing for this uploaded file was completed', default=None, ) result: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='information about the result of the file upload', default=None, ) import_asset_batch: Mapped['ImportAssetBatch'] = relationship( 'ImportAssetBatch', back_populates='import_asset', init=False ) import_asset_detail: Mapped[list['ImportAssetDetail']] = relationship( 'ImportAssetDetail', back_populates='import_asset', init=False ) release_captions: Mapped[list['ReleaseCaptions']] = relationship( 'ReleaseCaptions', back_populates='import_asset', init=False ) release_subtitles: Mapped[list['ReleaseSubtitles']] = relationship( 'ReleaseSubtitles', back_populates='import_asset', init=False ) class IodaCleanupImportAssets(Base): __tablename__ = 'ioda_cleanup_import_assets' __table_args__ = ( ForeignKeyConstraint( ['ioda_cleanup_asset_id'], ['ioda_cleanup_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_ioda_cleanup_import_assets', ), Index('FK_ioda_cleanup_import_assets', 'ioda_cleanup_asset_id'), Index('IDX_asset_type_id', 'asset_type_id'), Index('IDX_import_asset_id', 'import_asset_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) ioda_cleanup_asset_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) import_asset_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) asset_type_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) ioda_cleanup_asset: Mapped[Optional['IodaCleanupAssets']] = relationship( 'IodaCleanupAssets', back_populates='ioda_cleanup_import_assets', init=False ) class LicensingReviewStatus(Base, CreateMixin): __tablename__ = 'licensing_review_status' __table_args__ = ( ForeignKeyConstraint( ['blacklist_id'], ['blacklisted_songs.blacklist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_licensing_review_status', ), Index('FK_licensing_review_status', 'blacklist_id'), Index('match_id', 'track_id', 'blacklist_id', unique=True), Index('track_id', 'track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) blacklist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[Optional[str]] = mapped_column( ENUM('open', 'approved', 'compulsory_sent', 'pending_disney_approval'), default=None, ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) blacklist: Mapped['BlacklistedSongs'] = relationship( 'BlacklistedSongs', back_populates='licensing_review_status', init=False ) licensing_review_status_change_history: Mapped[ list['LicensingReviewStatusChangeHistory'] ] = relationship( 'LicensingReviewStatusChangeHistory', back_populates='licensing_review', init=False, ) class ManualAdjustment(Base, CreateMixin, UpdateMixin): __tablename__ = 'manual_adjustment' __table_args__ = ( ForeignKeyConstraint( ['category_id'], ['manual_adjustment_category.category_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_manual_adjustment_manual_adjustment_category', ), Index('category_id', 'category_id'), Index('currency_id', 'currencies_id'), Index('parent_id', 'parent_id'), {'comment': 'Accounting table holds manual adjustments related to label, '}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) parent_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to the parent table as indicated by the parent_type.', ) category_id: Mapped[int] = mapped_column(INTEGER, nullable=False) parent_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client', 'publisher', 'partner'), comment='This enumerated field indicates the parent of manual adjustment.', default=None, ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date manual adjustment was entered.', default=None, ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Amount for the manual adjustment.', default=None ) adjust_for_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Indicates the year for which adjustment needs to be applied.', default=None, ) adjust_for_quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Indicates the quarter for which adjustment needs to be applied.', default=None, ) apply_to_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Indicates the year in which adjustment was applied.', default=None, ) apply_to_quarter: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Indicates the quarter in which adjustment was applied.', default=None, ) comment: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='This field holds the reason why the manual adjustment was entered.', default=None, ) category: Mapped[Optional[str]] = mapped_column( ENUM( 'label_earnings', 'publisher_earnings', 'legal_fees', 'label_publisher_costs', 'admin_fees', 'reclass_between_labels', 'returned_check', 'stale_dated_check', ), default=None, ) adjust_for_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) apply_to_period_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) currencies_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key of currencies table', default=None ) amount_in_original_currency: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Original amount', default=None ) attachment_location: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table indicates the user who entered the manual adjustment.', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the manual_adjustment record.', default=None, ) category_: Mapped['ManualAdjustmentCategory'] = relationship( 'ManualAdjustmentCategory', back_populates='manual_adjustment', init=False ) release_payment_log: Mapped[list['ReleasePaymentLog']] = relationship( 'ReleasePaymentLog', back_populates='manual_adjustment', init=False ) release_manual_adjustment: Mapped[list['ReleaseManualAdjustment']] = relationship( 'ReleaseManualAdjustment', back_populates='vendor_manual_adjustment', init=False ) api_invoice_payment_logs: Mapped[list['ApiInvoicePaymentLogs']] = relationship( 'ApiInvoicePaymentLogs', back_populates='manual_adjustment', init=False ) class MasterBlacklist(Base): __tablename__ = 'master_blacklist' __table_args__ = ( ForeignKeyConstraint( ['added_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_master_blacklist_added_by', ), Index('FK_master_blacklist_added_by', 'added_by'), ) master_blacklist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) blacklist_word: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) reason: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_general_ci'), comment='Blacklist Reason for Blacklist word', default=None, ) added_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='OA User that added the Blacklist word', default=None ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='master_blacklist', init=False ) class MktPriorityProject(Base, CreateMixin): __tablename__ = 'mkt_priority_project' __table_args__ = ( ForeignKeyConstraint( ['project_id'], ['project.project_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_projectId', ), Index('FK_projectId', 'project_id'), ) mkt_priority_project_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) project_id: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to project table.' ) priority: Mapped[str] = mapped_column( ENUM('a', 'b'), nullable=False, server_default=text("'b'"), comment='Marketing priority of the project.', ) country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Country id from country table.', ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) created_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) project: Mapped['Project'] = relationship( 'Project', back_populates='mkt_priority_project', init=False ) class OrchadminPermissions(Base): __tablename__ = 'orchadmin_permissions' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_privilege_id'], ['orchadmin_privileges.orchadmin_privilege_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_privilege_id', ), ForeignKeyConstraint( ['orchadmin_resource_id'], ['orchadmin_resources.orchadmin_resource_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_resource_id', ), Index('FK_orchadmin_privilege_id', 'orchadmin_privilege_id'), Index('FK_orchadmin_resource_id', 'orchadmin_resource_id'), ) orchadmin_permission_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) orchadmin_resource_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchadmin_privilege_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) old_orchadmin_permission_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) orchadmin_privilege: Mapped[Optional['OrchadminPrivileges']] = relationship( 'OrchadminPrivileges', back_populates='orchadmin_permissions', init=False ) orchadmin_resource: Mapped[Optional['OrchadminResources']] = relationship( 'OrchadminResources', back_populates='orchadmin_permissions', init=False ) orchadmin_role_permissions: Mapped[list['OrchadminRolePermissions']] = relationship( 'OrchadminRolePermissions', back_populates='orchadmin_permission', init=False ) class OrchadminUserOwners(Base): __tablename__ = 'orchadmin_user_owners' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_user_id'], ['orchadmin_users.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_oa_user_owner_orchadmin_user_id', ), ForeignKeyConstraint( ['owner_id'], ['owner.owner_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_oa_user_owner_owner_id', ), Index('FK_oa_user_owner_orchadmin_user_id', 'orchadmin_user_id'), Index('FK_oa_user_owner_owner_id', 'owner_id'), {'comment': 'This table contains OA user owners.'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) orchadmin_user_id: Mapped[int] = mapped_column(INTEGER, nullable=False) owner_id: Mapped[int] = mapped_column(INTEGER, nullable=False) orchadmin_user: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='orchadmin_user_owners', init=False ) owner: Mapped['Owner'] = relationship( 'Owner', back_populates='orchadmin_user_owners', init=False ) class OrchadminUserRoles(Base, UpdateMixin): __tablename__ = 'orchadmin_user_roles' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_role_id'], ['orchadmin_roles.orchadmin_role_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_user_roles_role_id', ), ForeignKeyConstraint( ['orchadmin_user_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_user_roles_user_id', ), Index('NewIndex1', 'orchadmin_role_id'), Index( 'orchadmin_user_role', 'orchadmin_user_id', 'orchadmin_role_id', unique=True ), {'comment': 'Intermediary table for many to many relationship which links'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_users table.', ) orchadmin_role_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_roles table.', ) master: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment="Yes or No indicates whether it's a master role.", ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user that modified the record. Example: oa or alw', default=None, ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Id of user that modified the record. Example: orchadmin_users.id or vend_contact.id.', default=None, ) orchadmin_role: Mapped['OrchadminRoles'] = relationship( 'OrchadminRoles', back_populates='orchadmin_user_roles', init=False ) orchadmin_user: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='orchadmin_user_roles', init=False ) class OrchadminUserSavedQuery(Base): __tablename__ = 'orchadmin_user_saved_query' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_user_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_user_saved_query', ), Index('orchadmin_user_id', 'orchadmin_user_id'), {'comment': 'Holds all user specific records of saved reports and saved s'}, ) saved_query_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who created this entry.', ) query_type: Mapped[str] = mapped_column( ENUM('search', 'report'), nullable=False, server_default=text("'search'"), comment='Type of the query. Value can be search or report.', ) orchadmin_sub_type: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False, comment='Sub type of the query.', ) query_name: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Name of the query.' ) is_download: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'Y'") ) description: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Descriptive text of the query.', default=None ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date this query is created.', default=None ) last_run: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the query is last run.', default=None ) period: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Frequency of the query to be run.', default=None ) expiration_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Expiration date of the query.', default=None ) error_message: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Error message if any when running the query.', default=None, ) report: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Report text of the query result.', default=None ) total_run_time: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Total run time of the query.', default=None ) orchadmin_user: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='orchadmin_user_saved_query', init=False ) orchadmin_user_saved_query_criteria: Mapped[ list['OrchadminUserSavedQueryCriteria'] ] = relationship( 'OrchadminUserSavedQueryCriteria', back_populates='saved_query', init=False ) class PhfPublishingEscrow(Base, UpdateMixin): __tablename__ = 'phf_publishing_escrow' __table_args__ = ( ForeignKeyConstraint( ['period_id'], ['period.period_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_phf_period', ), ForeignKeyConstraint( ['track_id'], ['phf_mechadmin_track.track_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_phf_track', ), Index('FK_phf_period', 'period_id'), Index('FK_phf_track', 'track_id'), Index('active', 'active'), Index('sales_file_name', 'sales_file_name'), ) phf_transaction_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[str] = mapped_column( String(200, 'utf8mb4_general_ci'), nullable=False, comment='Finetunes or Phonofile phf_mechadmin_track.track_id, not related to art_relations.track table', ) store: Mapped[str] = mapped_column(String(30, 'utf8mb4_general_ci'), nullable=False) qty: Mapped[int] = mapped_column(Integer, nullable=False) ownership: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'1'") ) royalty_rate_calculated: Mapped[decimal.Decimal] = mapped_column( DECIMAL(20, 12), nullable=False ) royalty_calculated: Mapped[decimal.Decimal] = mapped_column( DECIMAL(20, 12), nullable=False ) period_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) sales_file_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) active: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Flag shows whether should the record be used in license requests or usage reports or not', ) last_modified: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) transaction_type: Mapped[Optional[str]] = mapped_column( String(10, 'utf8mb4_general_ci'), default=None ) usage_type: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) royalty_rate: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) royalty: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) gross_revenue: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) net_revenue: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) dist_fee: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) admin_fee: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(20, 12), default=None ) period: Mapped['Period'] = relationship( 'Period', back_populates='phf_publishing_escrow', init=False ) track: Mapped['PhfMechadminTrack'] = relationship( 'PhfMechadminTrack', back_populates='phf_publishing_escrow', init=False ) class ProductSubtype(Base): __tablename__ = 'product_subtype' __table_args__ = ( ForeignKeyConstraint( ['product_type_id'], ['product_type.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_product_subtype_product_type_id', ), Index('FK_product_subtype_product_type_id', 'product_type_id'), Index('subtypeIndex', 'subtype', 'product_type_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) subtype: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_general_ci'), default=None ) product_type_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) product_type: Mapped[Optional['ProductType']] = relationship( 'ProductType', back_populates='product_subtype', init=False ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='product_subtype', init=False ) t_region_country = Table( 'region_country', Base.metadata, Column( 'region_id', SMALLINT, nullable=False, server_default=text("'0'"), comment='Foreign key to region table.', ), Column( 'country_id', SMALLINT, nullable=False, server_default=text("'0'"), comment='Foreign key to country table.', ), ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_region_country_country_id', ), ForeignKeyConstraint( ['region_id'], ['region.region_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_region_country', ), Index('country_id', 'country_id'), Index('region_country', 'region_id', 'country_id'), Index('region_id', 'region_id'), comment='Relationship table between region and country tables', ) class ReleaseMfitInfo(Base): __tablename__ = 'release_mfit_info' __table_args__ = ( ForeignKeyConstraint( ['mfit_studio_id'], ['mfit_studio.id'], name='FK_mfit_studio' ), Index('FK_mfit_studio', 'mfit_studio_id'), ) release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='release_id as primary key' ) mfit_studio_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to mfit_studio table' ) mfit_studio: Mapped['MfitStudio'] = relationship( 'MfitStudio', back_populates='release_mfit_info', init=False ) class ReleaseRatingAdvisorySystem(Base): __tablename__ = 'release_rating_advisory_system' __table_args__ = ( ForeignKeyConstraint( ['rating_advisory_system_id'], ['rating_advisory_system.rating_advisory_system_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_rating_advisory_system_id', ), Index('FK_rating_advisory_system_id', 'rating_advisory_system_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), ) release_rating_advisory_system_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table', default=None ) rating_advisory_system_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to rating_advisory_system table', default=None ) reason: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) rating_advisory_system: Mapped[Optional['RatingAdvisorySystem']] = relationship( 'RatingAdvisorySystem', back_populates='release_rating_advisory_system', init=False, ) class RightsAttributesSuggestionKeywords(Base): __tablename__ = 'rights_attributes_suggestion_keywords' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_ra_keywords_rights_attribute_id', ), Index( 'UC_Rights_Attribute_Keyword', 'rights_attribute_id', 'keyword', unique=True ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) keyword: Mapped[str] = mapped_column(VARCHAR(256), nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='rights_attributes_suggestion_keywords', init=False, ) class SocialReferences(Base): __tablename__ = 'social_references' __table_args__ = ( ForeignKeyConstraint( ['site_id'], ['sites.id'], name='FK_social_references_site' ), Index('FK_social_references_site', 'site_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) site_id: Mapped[int] = mapped_column(INTEGER, nullable=False) resource_type: Mapped[str] = mapped_column( ENUM('REMINDER', 'EVENT', 'PHOTO', 'TWEET', 'VIDEO', 'BIO', 'NEWS'), nullable=False, ) reference_id: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) site: Mapped['Sites'] = relationship( 'Sites', back_populates='social_references', init=False ) artist_bio_social_references: Mapped[list['ArtistBioSocialReferences']] = ( relationship( 'ArtistBioSocialReferences', back_populates='social_reference', init=False ) ) artist_news_social_references: Mapped[list['ArtistNewsSocialReferences']] = ( relationship( 'ArtistNewsSocialReferences', back_populates='social_reference', init=False ) ) artist_photo_social_references: Mapped[list['ArtistPhotoSocialReferences']] = ( relationship( 'ArtistPhotoSocialReferences', back_populates='social_reference', init=False ) ) artist_profilephoto_social_references: Mapped[ list['ArtistProfilephotoSocialReferences'] ] = relationship( 'ArtistProfilephotoSocialReferences', back_populates='social_reference', init=False, ) artist_tourdate_social_references: Mapped[ list['ArtistTourdateSocialReferences'] ] = relationship( 'ArtistTourdateSocialReferences', back_populates='social_reference', init=False ) artist_video_social_references: Mapped[list['ArtistVideoSocialReferences']] = ( relationship( 'ArtistVideoSocialReferences', back_populates='social_reference', init=False ) ) class SocialSitePreferences(Base): __tablename__ = 'social_site_preferences' __table_args__ = ( ForeignKeyConstraint( ['site_id'], ['sites.id'], name='FK_social_site_preferences_site' ), Index('FK_social_site_preferences_site', 'site_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) site_id: Mapped[int] = mapped_column(INTEGER, nullable=False) action: Mapped[str] = mapped_column(ENUM('ADD', 'UPDATE', 'DELETE'), nullable=False) resource: Mapped[str] = mapped_column( ENUM('TOUR_DATE', 'PHOTO', 'PROFILE_PHOTO', 'BIO', 'VIDEO', 'NEWS'), nullable=False, ) method: Mapped[str] = mapped_column( ENUM('SINGLE', 'MULTIPLE', 'DAYOF'), nullable=False ) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) site: Mapped['Sites'] = relationship( 'Sites', back_populates='social_site_preferences', init=False ) artist_social_preferences: Mapped[list['ArtistSocialPreferences']] = relationship( 'ArtistSocialPreferences', back_populates='preference', init=False ) t_store_classification_detail = Table( 'store_classification_detail', Base.metadata, Column( 'store_id', SMALLINT, primary_key=True, comment='Reference of customer master master.', ), Column( 'classification_detail_id', SMALLINT, primary_key=True, comment='Reference of classification details.', ), ForeignKeyConstraint( ['classification_detail_id'], ['classification_detail.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_for_classification_detail', ), ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_for_store', ), Index('FK_for_classification_detail', 'classification_detail_id'), ) class StoreException(Base): __tablename__ = 'store_exception' __table_args__ = ( ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_store_exception_store_id', ), Index('FK_store_exception_store_id', 'store_id'), ) store_exception_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) store_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Store identifier' ) updated_on: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Last updated date and time', ) updated_by: Mapped[int] = mapped_column( Integer, nullable=False, comment='User identifier from orchadmin_users table' ) exception_type: Mapped[Optional[str]] = mapped_column( ENUM( 'label', 'label_country', 'subaccount', 'participant', 'participant_country', 'product', ), comment='The exception type could be label, label country, participant etc.', default=None, ) store: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='store_exception', init=False ) store_exception_detail: Mapped[list['StoreExceptionDetail']] = relationship( 'StoreExceptionDetail', back_populates='store_exception', init=False ) class Subgenre(Base): __tablename__ = 'subgenre' __table_args__ = ( ForeignKeyConstraint( ['genre_id'], ['genre.genre_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subgenre', ), Index('unique_genreid_subgenrename', 'genre_id', 'name'), {'comment': 'Hold subgenres'}, ) name: Mapped[str] = mapped_column(String(80, 'utf8mb4_general_ci'), nullable=False) genre_id: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Foreign key to genre table.' ) orchard_id: Mapped[int] = mapped_column( SMALLINT, primary_key=True, comment='Real primary key of subgenre.', autoincrement=True, init=False, ) music_video: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Flag that indicates whether this subgenre is available to music video', default=None, ) composer: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Flag that indicates whether this subgenre requires a composer to be specified', default=None, ) genre: Mapped['Genre'] = relationship( 'Genre', back_populates='subgenre', init=False ) dms_genre_mapping: Mapped[list['DmsGenreMapping']] = relationship( 'DmsGenreMapping', back_populates='orchard_subgenre', init=False ) rights_attributes_suggestion_genre_subgenre_keywords: Mapped[ list['RightsAttributesSuggestionGenreSubgenreKeywords'] ] = relationship( 'RightsAttributesSuggestionGenreSubgenreKeywords', back_populates='subgenre', init=False, ) dms_subgenre_mapping: Mapped[list['DmsSubgenreMapping']] = relationship( 'DmsSubgenreMapping', back_populates='orchard_subgenre', init=False ) release_subgenre: Mapped[list['ReleaseSubgenre']] = relationship( 'ReleaseSubgenre', back_populates='subgenre', init=False ) class SupplyChainDefaults(Base): __tablename__ = 'supply_chain_defaults' __table_args__ = ( ForeignKeyConstraint( ['distribution_format_media_id'], ['distribution_format_media.distribution_format_media_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_distribution_format_media_id1', ), ForeignKeyConstraint( ['supply_chain_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_supply_chain_id1', ), Index('FK_distribution_format_media_id1', 'distribution_format_media_id'), Index('FK_supply_chain_id1', 'supply_chain_id'), ) supply_chain_default_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='primary key of table.', autoincrement=True, init=False, ) supply_chain_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Store ID. foreign of customer_master_master.customer_master_master_id', ) distribution_format_media_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign of distribution_format_media.distribution_format_media_id', default=None, ) is_returnable: Mapped[Optional[int]] = mapped_column( TINYINT(1), comment='Indicates whether Product is returnable for the Supply Chain', default=None, ) return_disposition: Mapped[Optional[str]] = mapped_column( ENUM('Keep', 'Scrap'), comment='Stores return disposition', default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='Date when record is added', default=None, ) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date when record is updated', default=None, ) distribution_format_media: Mapped[Optional['DistributionFormatMedia']] = ( relationship( 'DistributionFormatMedia', back_populates='supply_chain_defaults', init=False, ) ) supply_chain: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='supply_chain_defaults', init=False ) class TourDates(Base): __tablename__ = 'tour_dates' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tour_dates_artist_info', ), ForeignKeyConstraint( ['country'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tour_dates_country', ), ForeignKeyConstraint( ['state_id'], ['orchard_state.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tour_dates_orchard_state', ), Index('FK_tour_dates_artist_info', 'artist_id'), Index('FK_tour_dates_country', 'country'), Index('FK_tour_dates_orchard_state', 'state_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) publish: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) venue_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) address: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) city: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) zip: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) state_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) other_state: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) country: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) phone: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), default=None ) website: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) show_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) show_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) door_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) ticket_price: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) age_limit: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_general_ci'), default=None ) date_added: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) ticket_status: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) longitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), default=None ) latitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), default=None ) import_source: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) more_info: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) ticket_on_sale_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) timezoneId: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='tour_dates', init=False ) country_: Mapped[Optional['Country']] = relationship( 'Country', back_populates='tour_dates', init=False ) state: Mapped[Optional['OrchardState']] = relationship( 'OrchardState', back_populates='tour_dates', init=False ) tour_date_other_artists: Mapped[list['TourDateOtherArtists']] = relationship( 'TourDateOtherArtists', back_populates='tour_date', init=False ) tourdate_buylinks: Mapped[list['TourdateBuylinks']] = relationship( 'TourdateBuylinks', back_populates='tour_date', init=False ) class TrackVideo(Base): __tablename__ = 'track_video' __table_args__ = ( ForeignKeyConstraint( ['youtube_channel_video_category_id'], ['youtube_channel_video_category.id'], name='FK_track_video_category', ), Index('FK_track_video_category', 'youtube_channel_video_category_id'), {'comment': 'Holds informatin of video track that are already in catalog'}, ) id: Mapped[int] = mapped_column(INTEGER, primary_key=True) season_no_REMOVE: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) episode_no_REMOVE: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) language_REMOVE: Mapped[Optional[str]] = mapped_column( String(3, 'utf8mb4_general_ci'), server_default=text("'ENG'"), default=None ) color: Mapped[Optional[str]] = mapped_column( ENUM('black_and_white', 'color'), server_default=text("'color'"), default=None ) keywords: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) synopsis_REMOVE: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) production_co_REMOVE: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) copyright: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) aspect_ratio: Mapped[Optional[str]] = mapped_column( ENUM( '1.85:1', '10:7', '16:9', '20:11', '20:13', '20:7', '20:9', '3:2', '40:17', '40:19', '40:21', '40:23', '40:27', '40:29', '4:2', '4:3', '5:2', '5:3', '5:4', '8:3', '8:5', ), default=None, ) master_quality: Mapped[Optional[str]] = mapped_column( ENUM('lofi', 'hifi'), default=None ) download_pricing: Mapped[Optional[float]] = mapped_column(Float, default=None) rental_pricing: Mapped[Optional[float]] = mapped_column(Float, default=None) streaming_pricing: Mapped[Optional[float]] = mapped_column(Float, default=None) resolution: Mapped[Optional[str]] = mapped_column( ENUM('SD', '720HD', '1080HD', '4K'), default=None ) fps: Mapped[Optional[str]] = mapped_column( ENUM('30', '25', '24', '15', '12'), default=None ) mastered: Mapped[Optional[str]] = mapped_column( ENUM('y', 'n'), server_default=text("'n'"), default=None ) channel: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) youtube_uploads: Mapped[Optional[str]] = mapped_column( ENUM('Fingerprint Only', 'Public', 'Private'), default=None ) subtitles_burned: Mapped[Optional[str]] = mapped_column( ENUM('forced_narrative', 'burned_in_subtitles'), default=None ) youtube_channel_video_category_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) youtube_video_id: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='youtube_video_id value of youtube_channel_video_status table', default=None, ) subtitles_burned_preview: Mapped[Optional[str]] = mapped_column( ENUM('forced_narrative', 'burned_in_subtitles'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) youtube_channel_video_category: Mapped[Optional['YoutubeChannelVideoCategory']] = ( relationship( 'YoutubeChannelVideoCategory', back_populates='track_video', init=False ) ) class UiRestrictions(Base): __tablename__ = 'ui_restrictions' __table_args__ = ( ForeignKeyConstraint( ['feature_id'], ['features.feature_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_feature_id_ui_restrictions', ), ForeignKeyConstraint( ['ui_accounttype_id'], ['ui_accounttype.ui_accounttype_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_ui_accounttype_ui_restrictions', ), Index('FK_feature_id_ui_restrictions', 'feature_id'), Index('FK_ui_accounttype_ui_restrictions', 'ui_accounttype_id'), ) ui_restriction_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) description: Mapped[str] = mapped_column( String(255, 'utf8mb4_bin'), nullable=False, comment='Describe the UI element this record is restricting.', ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Auto populated', ) feature_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Fkey to features table, if a feature ui restriction', default=None, ) ui_accounttype_id: Mapped[Optional[int]] = mapped_column( Integer, comment='FKey to ui_accounttype table, if an account type ui restriction', default=None, ) controller: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_bin'), comment='Controller name by itself restricts access to whole controller', default=None, ) action: Mapped[Optional[str]] = mapped_column( String(40, 'utf8mb4_bin'), comment='Controller name plus action name restricts access to that action.', default=None, ) other: Mapped[Optional[str]] = mapped_column( String(35, 'utf8mb4_bin'), comment='Restrict access to section that is not a controller or action (ie. nav button, etc)', default=None, ) other_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_bin'), comment='Important!! If "other" has a value, enter a path to it here. For info only.', default=None, ) feature: Mapped[Optional['Features']] = relationship( 'Features', back_populates='ui_restrictions', init=False ) ui_accounttype: Mapped[Optional['UiAccounttype']] = relationship( 'UiAccounttype', back_populates='ui_restrictions', init=False ) class VectorapiUserAuth(Base): __tablename__ = 'vectorapi_user_auth' __table_args__ = ( ForeignKeyConstraint( ['user_id'], ['vectorapi_user.user_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vectorapi_user_id', ), Index('FK_vectorapi_user_id', 'user_id'), ) user_auth_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) user_id: Mapped[int] = mapped_column(Integer, nullable=False) access_status: Mapped[str] = mapped_column( ENUM('unapproved', 'approved'), nullable=False ) request_token: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) request_secret: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_access_key: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_access_secret: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) user: Mapped['VectorapiUser'] = relationship( 'VectorapiUser', back_populates='vectorapi_user_auth', init=False ) class VendorAgreement(Base): __tablename__ = 'vendor_agreement' __table_args__ = ( ForeignKeyConstraint( ['opt_in_preference_id'], ['opt_in_preference.opt_in_preference_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_opt_in_preference_id', ), Index('FK_opt_in_preference_id', 'opt_in_preference_id'), Index('FK_vendor_id', 'vendor_id'), Index('UC_Agreement', 'vendor_id', 'opt_in_preference_id', unique=True), ) vendor_agreement_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) opt_in_preference_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign Key' ) vendor_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign Key' ) date_accepted: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), comment='The date that agreement is accepted', default=None, ) user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='The unique identifier of a workstation user (vend_contact.id). The purpose of this field is to know which workstation user has accepted a vendor_agreement.', default=None, ) impersonator_user_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='The impersonator_user_id as retrieved from the local storage.', default=None, ) opt_in_preference: Mapped['OptInPreference'] = relationship( 'OptInPreference', back_populates='vendor_agreement', init=False ) class VendorContract(Base): __tablename__ = 'vendor_contract' __table_args__ = ( ForeignKeyConstraint( ['service_type_id'], ['service_type.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_service_type', ), Index('FK_service_type', 'service_type_id'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds all contracts of labels'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) reserve_rate: Mapped[decimal.Decimal] = mapped_column( DECIMAL(4, 2), nullable=False, server_default=text("'0.00'") ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) cont_start: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Contract start date.', default=None ) cont_end: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Contract end date.', default=None ) cont_version: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Contract version.', default=None ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('yes_digital', 'yes_physical', 'yes_both', 'no_both', 'y', 'n'), server_default=text("'no_both'"), comment="Yes or No indicates whether there''s exclusivity on the contract.", default=None, ) orchrep_name: Mapped[Optional[str]] = mapped_column( String(55, 'utf8mb4_general_ci'), comment='Name of the Orchard rep.', default=None, ) carve_out: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Deprecated', default=None ) qualification_level: Mapped[Optional[str]] = mapped_column( String(44, 'utf8mb4_general_ci'), comment='Qualification level of the contract.', default=None, ) territory_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Countries that are restricted from the contract.', default=None, ) dms_carve_out: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='DMS customers that are restricted from the contract.', default=None, ) dms_master_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='DMS master master that are restricted from the contract.', default=None, ) encoding_fees_cap_back_ctlg: Mapped[Optional[float]] = mapped_column( Float, comment='Encoding fees cap for back catalogue.', default=None ) encoding_fees_cap_new_release: Mapped[Optional[float]] = mapped_column( Float, comment='Encoding fees cap for new releases.', default=None ) digital_split: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(6, 4), comment='Digital split between label and Orchard.', default=None ) physical_split: Mapped[Optional[float]] = mapped_column( Float, comment='Physical split between label and Orchard.', default=None ) contract_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor_term', 'per_release_term'), server_default=text("'vendor_term'"), comment="Type of contract. Value can be 'vendor_term' or 'per_release_term'.", default=None, ) release_term: Mapped[Optional[int]] = mapped_column( Integer, comment='Number of years for the contract if the contract type is per_release_term.', default=None, ) advance_payment: Mapped[Optional[float]] = mapped_column( Float, comment='Advanced payment amount.', default=None ) advance_recoupable_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='Advanced recoupable percentage.', default=None ) dig_distribution_type: Mapped[Optional[str]] = mapped_column( ENUM('digital_mobile', 'digital_only', 'mobile_only'), server_default=text("'digital_mobile'"), comment="Digital distribution type of the track. Value can be 'digital_mobile', 'digital_only', or 'mobile_only'.", default=None, ) possible_track_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment="Yes or No indicates whether there's possible restrictions on tracks.", default=None, ) oms_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), server_default=text("'none'"), comment="Type of OMS. Value can be 'none', 'both', 'orchard', or 'label'.", default=None, ) oms_fee_percentage: Mapped[Optional[float]] = mapped_column( Float, comment='OMS fee percentage.', default=None ) negotiated_changes: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment="Yes or No indicates whether there's negotiated changes.", default=None, ) negotiated_change_comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Negotiated change comment text.', default=None, ) contract_complete: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates if the contract has been reviewed by Legal and marked as completed.', default=None, ) signature_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date of signature.', default=None ) marketing_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement has marketing restrictions.', default=None, ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement has orchard assignment right.', default=None, ) currency_id: Mapped[Optional[int]] = mapped_column( SMALLINT, server_default=text("'1'"), comment='Foreign key to currency table.', default=None, ) third_party_responsibility: Mapped[Optional[str]] = mapped_column( ENUM('standard', 'other'), server_default=text("'standard'"), comment='Indicates whether the agreement has third party responsibility.', default=None, ) third_party_responsibility_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detail of third party responsibility.', default=None, ) possible_track_restriction_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detail of possible track_restrictions.', default=None, ) is_amendment: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement is an amendment.', default=None, ) extend_until_recouped: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether the agreement should extend until recoupment.', default=None, ) sync_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Syncronization Admin Territory multi-select dropdown of countries', default=None, ) sync_admin_commission: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Sync Admin Split textbox. Enter 0.75 for 75%', default=None, ) sync_admin_type_of_deal: Mapped[Optional[str]] = mapped_column( ENUM('master_admin', 'master_or_publishing_admin', 'publishing_admin_only'), comment='Sync Admin Type of Deal dropdown', default=None, ) royalty_collection_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Royalty Collection Territory Multi-select dropdown of countries. ', default=None, ) royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, comment='Royalty Collection Split textbox. Enter 0.75 for 75%', default=None, ) publishing_admin_commission: Mapped[Optional[float]] = mapped_column( Float, comment='Publishing Administration Split textbox. Enter 0.75 for 75%', default=None, ) publishing_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Publishing Admin Territory multi-select dropdown of countries', default=None, ) publishing_admin_limit_grant_of_rights: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publishing Administration Limit Grant of Rights field', default=None, ) publishing_admin_misc_provisions: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publishing Administration Misc Previsions field', default=None, ) parent_vendor_contract_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Contract id of the previous version of this contract', default=None, ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), server_default=text("'vendor'"), comment='indicate whether this contract is for Label or OMS Client', default=None, ) vendor_proposed_term_id: Mapped[Optional[int]] = mapped_column( Integer, comment='foreign key referencing vendor proposed term table', default=None, ) sync_admin_response_time: Mapped[Optional[int]] = mapped_column( Integer, comment='Sync Admin Response Time textbox', default=None ) ringtone_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('both', 'label', 'orchard', 'none'), server_default=text("'none'"), comment='Take Ringtone Publishing dropdown', default=None, ) physical_track_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), server_default=text("'none'"), comment='Field to store physical track publishing ', default=None, ) unlimited_roll: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Unlimited Roll dropdown', default=None, ) rollover_length_in_months: Mapped[Optional[int]] = mapped_column( Integer, comment='Rollover Length in Months textfield', default=None ) can_terminate: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Can Terminate before Rollover Ends dropdown', default=None, ) youtube_composition_clause: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) sx_royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) notice_required_in_days: Mapped[Optional[int]] = mapped_column( Integer, comment='Notice Required in Days textbox', default=None ) term_continues_until_recouped: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Term Continues until Recouped dropdown', default=None, ) brand_split: Mapped[Optional[float]] = mapped_column( Float, comment="Label's Split - BRAND textfield in edit vendor contract page", default=None, ) other_rights_option: Mapped[Optional[str]] = mapped_column( ENUM('any_and_all', 'other', 'none'), server_default=text("'any_and_all'"), comment='Other rights', default=None, ) other_rights_text: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Other rights text for "other" option', default=None, ) special_product_split: Mapped[Optional[float]] = mapped_column(Float, default=None) special_product_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) payment_interval: Mapped[Optional[str]] = mapped_column( ENUM('month', 'quarter'), server_default=text("'quarter'"), comment='How often the payment is due', default=None, ) pay_after: Mapped[Optional[str]] = mapped_column( ENUM('30', '45', '60', '90'), server_default=text("'45'"), comment='Days before payment is due', default=None, ) show_credit_card: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) opt_out: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether or not deliver content to stores. Default N indicates, opt out is false and content can be delivered', default=None, ) apply_fx_spread: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes OR NO indicates whether or not to apply FX Spread calculations during the monthly accounting process', default=None, ) number_of_months_before_payout: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) number_of_installments: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) contract_terms: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) service_type_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Service type for the contract', default=None ) is_automatic_rollover: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) service_type: Mapped[Optional['ServiceType']] = relationship( 'ServiceType', back_populates='vendor_contract', init=False ) vendor_contract_compilation: Mapped[list['VendorContractCompilation']] = ( relationship( 'VendorContractCompilation', back_populates='vendor_contract', init=False ) ) vendor_contract_distribution_type: Mapped[ list['VendorContractDistributionType'] ] = relationship( 'VendorContractDistributionType', back_populates='vendor_contract', init=False ) vendor_territory_restriction: Mapped[list['VendorTerritoryRestriction']] = ( relationship( 'VendorTerritoryRestriction', back_populates='vendor_contract', init=False ) ) class VendorPermissions(Base): __tablename__ = 'vendor_permissions' __table_args__ = ( ForeignKeyConstraint( ['privilege_id'], ['vendor_privilege.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_permissions_privilege_id', ), ForeignKeyConstraint( ['resource_id'], ['vendor_resource.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_permissions_resource_id', ), Index('privilege_idx', 'privilege_id'), Index('resource_idx', 'resource_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) resource_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_resource id' ) privilege_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor_privilege id', default=None ) privilege: Mapped[Optional['VendorPrivilege']] = relationship( 'VendorPrivilege', back_populates='vendor_permissions', init=False ) resource: Mapped['VendorResource'] = relationship( 'VendorResource', back_populates='vendor_permissions', init=False ) class VendorProposedTerm(Base, CreateMixin): __tablename__ = 'vendor_proposed_term' __table_args__ = ( ForeignKeyConstraint( ['service_type_id'], ['service_type.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_proposed_service_type_id', ), Index('FK_proposed_service_type_id', 'service_type_id'), Index('vendor_id', 'vendor_id'), {'comment': 'Holds proposed terms of labels'}, ) vendor_proposed_term_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) reserve_rate: Mapped[float] = mapped_column( FLOAT(10, 2), nullable=False, server_default=text("'0.00'") ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to the vendor table.', default=None ) budgeted_advance: Mapped[Optional[float]] = mapped_column( Float, comment='The amount allocated toward advace.', default=None ) advance_offered: Mapped[Optional[float]] = mapped_column( Float, comment='The amount offered as an advance.', default=None ) proposed_term: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Description of the proposed term.', default=None, ) proposed_split: Mapped[Optional[float]] = mapped_column( Float, comment='Proposed split.', default=None ) chance_to_close: Mapped[Optional[float]] = mapped_column( Float, comment='Float value indicating the chance of closing the deal.', default=None, ) eta_to_close_quarter: Mapped[Optional[int]] = mapped_column( Integer, comment='Quarter of the period when the deal is expected to be closed.', default=None, ) eta_to_close_year: Mapped[Optional[int]] = mapped_column( Integer, comment='Year of the period when the deal is expected to be closed.', default=None, ) type: Mapped[Optional[str]] = mapped_column( ENUM('new', 'renewal'), server_default=text("'new'"), comment='The type of proposed term.', default=None, ) status: Mapped[Optional[str]] = mapped_column( ENUM( 'pitched', 'pending', 'verbal', 'waiting_for_approval', 'approved', 'signed', 'passed', ), server_default=text("'pitched'"), comment='The status of proposed terms.', default=None, ) proposed_territory_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comma separated list of country ids indicating the restricted territory.', default=None, ) proposed_dms_carve_out: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Comma separated list of DMS indicating the restricted DMS.', default=None, ) proposed_dms_master_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Comma separated list of Master DMS indicating the restricted Master DMS.', default=None, ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The date propsed term was entered into the system.', default=None, ) encoding_fee: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Whether there is an encoding fee ', default=None, ) currency_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='currency type of budgeted_advance and advance_offered', default=None, ) proposed_rollover_period: Mapped[Optional[int]] = mapped_column( Integer, comment='Rollover period of the proposed term.', default=None ) srco_rep: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Flag indicates whether label has Sound Recording Copyright Owner Representative', default=None, ) sync_admin_commission: Mapped[Optional[float]] = mapped_column(Float, default=None) mech_admin: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Flag indicates whether or not mechanical admin is part of the deal.', default=None, ) additional_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Text field of additional notes regarding the propsed term.', default=None, ) advance_recoup_explanation: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Explaination of how advance recoupment will work.', default=None, ) status_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) accounting_approval: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) executive_approval: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) legal_approval: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, default=None ) publishing_admin_commission: Mapped[Optional[float]] = mapped_column( Float, default=None ) exclusive: Mapped[Optional[str]] = mapped_column( ENUM('yes_digital', 'yes_physical', 'yes_both', 'no_both'), default=None ) negotiated_changes: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) encoding_fees_cap_back_ctlg: Mapped[Optional[float]] = mapped_column( Float, default=None ) encoding_fees_cap_new_release: Mapped[Optional[float]] = mapped_column( Float, default=None ) digital_split: Mapped[Optional[float]] = mapped_column(Float, default=None) physical_split: Mapped[Optional[float]] = mapped_column(Float, default=None) advance_payment: Mapped[Optional[float]] = mapped_column(Float, default=None) possible_track_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) possible_track_restriction_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) oms_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), default=None ) oms_fee_percentage: Mapped[Optional[float]] = mapped_column(Float, default=None) marketing_restrictions: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) orchard_assignment_right_restriction: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) third_party_responsibility: Mapped[Optional[str]] = mapped_column( ENUM('standard', 'other'), default=None ) third_party_responsibility_detail: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) rights_granted: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) distribution_type_ids: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) cont_start: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) cont_end: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) sync_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) sync_admin_response_time: Mapped[Optional[int]] = mapped_column( Integer, default=None ) sync_admin_type_of_deal: Mapped[Optional[str]] = mapped_column( ENUM('master_admin', 'master_or_publishing_admin', 'publishing_admin_only'), default=None, ) royalty_collection_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) publishing_admin_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) publishing_admin_limit_grant_of_rights: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) publishing_admin_misc_provisions: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) orchrep_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) parent_vendor_contract_id: Mapped[Optional[int]] = mapped_column( Integer, default=None ) vendor_type: Mapped[Optional[str]] = mapped_column( ENUM('vendor', 'oms_client'), default=None ) negotiated_change_comments: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) date_sent_for_approval: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) advance_recoupable_percentage: Mapped[Optional[float]] = mapped_column( Float, default=None ) extend_until_recouped: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) ringtone_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('both', 'orchard', 'label', 'none'), server_default=text("'label'"), default=None, ) physical_track_publishing_type: Mapped[Optional[str]] = mapped_column( ENUM('none', 'both', 'orchard', 'label'), server_default=text("'none'"), comment='Field to store physical track publishing ', default=None, ) other_rights_option: Mapped[Optional[str]] = mapped_column( ENUM('any_and_all', 'other', 'none'), server_default=text("'any_and_all'"), comment='Other rights', default=None, ) other_rights_text: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Other rights text for "other" option', default=None, ) special_product_split: Mapped[Optional[float]] = mapped_column(Float, default=None) special_product_carve_out: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) payment_interval: Mapped[Optional[str]] = mapped_column( ENUM('month', 'quarter'), server_default=text("'quarter'"), comment='How often the payment is due', default=None, ) pay_after: Mapped[Optional[str]] = mapped_column( ENUM('30', '45', '60', '90'), server_default=text("'45'"), comment='Days before payment is due', default=None, ) show_credit_card: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) sx_royalty_collection_commission: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate: Mapped[Optional[float]] = mapped_column( Float, server_default=text("'0'"), default=None ) topspin_rate_territory: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) apply_fx_spread: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes OR NO indicates whether or not to apply FX Spread calculations during the monthly accounting process', default=None, ) opt_out: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether or not deliver content to stores. Default N indicates, opt out is false and content can be delivered', default=None, ) youtube_composition_clause: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), comment='Y or N for youtube_composition_clause', default=None, ) number_of_months_before_payout: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) number_of_installments: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'0'"), default=None ) contract_terms: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) service_type_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Service type for the contract', default=None ) created_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to orchadmin_users table indicates the user that entered the proposed term.', default=None, ) service_type: Mapped[Optional['ServiceType']] = relationship( 'ServiceType', back_populates='vendor_proposed_term', init=False ) vendor_proposed_term_compilation: Mapped[list['VendorProposedTermCompilation']] = ( relationship( 'VendorProposedTermCompilation', back_populates='vendor_proposed_term', init=False, ) ) class VideoDashboardItem(Base): __tablename__ = 'video_dashboard_item' __table_args__ = ( ForeignKeyConstraint( ['release_type_id'], ['release_type.release_type_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_type', ), ForeignKeyConstraint( ['status_type_id'], ['video_dashboard_status.status_type_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dashboard_status', ), Index('FK_asset', 'asset_id'), Index('FK_dashboard_status', 'status_type_id'), Index('FK_release_type', 'release_type_id'), Index('FK_releases', 'upc'), Index('FK_vendor', 'vendor_id'), ) dashboard_item_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) create_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) vendor_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) upc: Mapped[Optional[int]] = mapped_column(BIGINT, default=None) asset_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) flag: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), default=None ) release_type_id: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'0'"), default=None ) video_asset_type_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) status_type_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) item_description: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), default=None ) release_name: Mapped[Optional[str]] = mapped_column( String(140, 'utf8mb4_general_ci'), default=None ) asset_file_path: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), default=None ) release_type: Mapped[Optional['ReleaseType']] = relationship( 'ReleaseType', back_populates='video_dashboard_item', init=False ) status_type: Mapped[Optional['VideoDashboardStatus']] = relationship( 'VideoDashboardStatus', back_populates='video_dashboard_item', init=False ) video_dashboard_item_status: Mapped[list['VideoDashboardItemStatus']] = ( relationship( 'VideoDashboardItemStatus', back_populates='dashboard_item', init=False ) ) class YoutubeChannelPartnerStatusHistory(Base): __tablename__ = 'youtube_channel_partner_status_history' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_users_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_partner_status_history_orchadmin_users', ), ForeignKeyConstraint( ['youtube_channel_id'], ['youtube_channel.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_partner_status_history_channel', ), ForeignKeyConstraint( ['youtube_channel_partner_status_id'], ['youtube_channel_partner_status.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_partner_status_history', ), Index( 'FK_youtube_channel_partner_status_history', 'youtube_channel_partner_status_id', ), Index('FK_youtube_partner_status_history_channel', 'youtube_channel_id'), Index( 'FK_youtube_partner_status_history_orchadmin_users', 'orchadmin_users_id' ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Last updated date for record.', ) youtube_channel_partner_status_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key reference of youtube_channel_partner_status table.', default=None, ) youtube_channel_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key reference of youtube_channel table.', default=None ) status_signup_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Sign up date of user.', default=None ) orchadmin_users_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key reference of orchadmin_users table.', default=None ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='youtube_channel_partner_status_history', init=False, ) youtube_channel: Mapped[Optional['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='youtube_channel_partner_status_history', init=False, ) youtube_channel_partner_status: Mapped[Optional['YoutubeChannelPartnerStatus']] = ( relationship( 'YoutubeChannelPartnerStatus', back_populates='youtube_channel_partner_status_history', init=False, ) ) class YoutubeChannelServiceTierHistory(Base): __tablename__ = 'youtube_channel_service_tier_history' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_users_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_service_tier_history_orchadmin_users', ), ForeignKeyConstraint( ['youtube_channel_id'], ['youtube_channel.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='youtube_channel_service_tier_history_ibfk_1', ), ForeignKeyConstraint( ['youtube_channel_service_tier_id'], ['youtube_channel_service_tier.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_service_tier', ), Index('FK_youtube_channel_service_tier', 'youtube_channel_service_tier_id'), Index('FK_youtube_service_tier_history_channel', 'youtube_channel_id'), Index('FK_youtube_service_tier_history_orchadmin_users', 'orchadmin_users_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) youtube_channel_service_tier_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel_service_tier table.', default=None, ) youtube_channel_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of youtube_channel table.', default=None ) orchadmin_users_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of orchadmin_users table.', default=None ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='youtube_channel_service_tier_history', init=False, ) youtube_channel: Mapped[Optional['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='youtube_channel_service_tier_history', init=False, ) youtube_channel_service_tier: Mapped[Optional['YoutubeChannelServiceTier']] = ( relationship( 'YoutubeChannelServiceTier', back_populates='youtube_channel_service_tier_history', init=False, ) ) class YoutubeChannelUpc(Base): __tablename__ = 'youtube_channel_upc' __table_args__ = ( ForeignKeyConstraint( ['youtube_channel_id'], ['youtube_channel.id'], name='FK_youtube_channel_upc', ), Index('FK_youtube_channel_upc', 'youtube_channel_id'), ) youtube_channel_upc_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) youtube_channel_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Foreign key refernce of 'youtube_channel'." ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='UPC from releases table.' ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Acive or inactive state for upc field.', default=None, ) start_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date when upc is activated.', default=None ) end_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date when upc is inactivated.', default=None ) youtube_channel: Mapped['YoutubeChannel'] = relationship( 'YoutubeChannel', back_populates='youtube_channel_upc', init=False ) class Zipcodes(Base): __tablename__ = 'zipcodes' __table_args__ = ( ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_zipcodes_country_id', ), ForeignKeyConstraint( ['state_id'], ['orchard_state.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_zipcodes_state_id', ), Index('FK_zipcodes_country_id', 'country_id'), Index('FK_zipcodes_state_id', 'state_id'), Index('zipcode_country', 'zipcode', 'country_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) zipcode: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Zipcode', default=None ) longitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), comment='Longitude of the zipcode', default=None ) latitude: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(10, 6), comment='Latitude of the zipcode', default=None ) city: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='City name for the zipcode', default=None, ) state_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchard_state table', default=None ) state_other: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='State name/code of non-US state', default=None, ) country_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table', default=None ) country: Mapped[Optional['Country']] = relationship( 'Country', back_populates='zipcodes', init=False ) state: Mapped[Optional['OrchardState']] = relationship( 'OrchardState', back_populates='zipcodes', init=False ) class ApiImages(Base): __tablename__ = 'api_images' __table_args__ = ( ForeignKeyConstraint( ['image_asset_id'], ['image_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_image_asset_id', ), Index('FK_api_image_asset_id', 'image_asset_id'), ) api_image_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_image_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_image_type: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False ) api_image_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) image_asset_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) image_asset: Mapped[Optional['ImageAssets']] = relationship( 'ImageAssets', back_populates='api_images', init=False ) class ApiProductsScreenshots(Base): __tablename__ = 'api_products_screenshots' __table_args__ = ( ForeignKeyConstraint( ['image_asset_id'], ['image_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_products_screenshots_image_asset', ), Index('FK_api_products_screenshots_image_asset', 'image_asset_id'), ) api_product_screenshot_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_product_version_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) api_images_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) image_asset_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) image_asset: Mapped[Optional['ImageAssets']] = relationship( 'ImageAssets', back_populates='api_products_screenshots', init=False ) class ApiRolePermissions(Base): __tablename__ = 'api_role_permissions' __table_args__ = ( ForeignKeyConstraint( ['api_permission_id'], ['api_permissions.api_permission_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_role_permissions_permissions', ), ForeignKeyConstraint( ['api_role_id'], ['api_roles.api_role_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_role_permissions_roles', ), Index('FK_api_role_permissions_permissions', 'api_permission_id'), Index('FK_api_role_permissions_roles', 'api_role_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) api_permission_id: Mapped[int] = mapped_column(Integer, nullable=False) api_role_id: Mapped[int] = mapped_column(Integer, nullable=False) api_permission: Mapped['ApiPermissions'] = relationship( 'ApiPermissions', back_populates='api_role_permissions', init=False ) api_role: Mapped['ApiRoles'] = relationship( 'ApiRoles', back_populates='api_role_permissions', init=False ) class ArtistBioSocialReferences(Base): __tablename__ = 'artist_bio_social_references' __table_args__ = ( ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_bio_social_references_reference', ), Index('FK_artist_bio_social_references_artist', 'artist_id'), Index('FK_artist_bio_social_references_reference', 'social_reference_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_bio_social_references', init=False ) class ArtistNewsSocialReferences(Base): __tablename__ = 'artist_news_social_references' __table_args__ = ( ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_news_social_references_reference', ), Index('FK_artist_news_social_references_news', 'news_id'), Index('FK_artist_news_social_references_reference', 'social_reference_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) news_id: Mapped[int] = mapped_column(Integer, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_news_social_references', init=False ) class ArtistPhotoSocialReferences(Base): __tablename__ = 'artist_photo_social_references' __table_args__ = ( ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_photo_social_references_reference', ), Index('FK_artist_photo_social_references_photo', 'photo_id'), Index('FK_artist_photo_social_references_reference', 'social_reference_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) photo_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_photo_social_references', init=False ) class ArtistProfilephotoSocialReferences(Base): __tablename__ = 'artist_profilephoto_social_references' __table_args__ = ( ForeignKeyConstraint( ['photo_id'], ['artist_photos.artist_photo_id'], name='FK_artist_profilephoto_social_references_photo', ), ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_profilephoto_social_references_reference', ), Index('FK_artist_profilephoto_social_references_photo', 'photo_id'), Index( 'FK_artist_profilephoto_social_references_reference', 'social_reference_id' ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) photo_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) photo: Mapped['ArtistPhotos'] = relationship( 'ArtistPhotos', back_populates='artist_profilephoto_social_references', init=False, ) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_profilephoto_social_references', init=False, ) class ArtistSocialConnectionPreferences(Base): __tablename__ = 'artist_social_connection_preferences' __table_args__ = ( ForeignKeyConstraint( ['social_connection_id'], ['artist_social_connections.id'], name='FK_artist_social_connections_preferences_connections', ), Index( 'FK_artist_social_connections_preferences_connections', 'social_connection_id', ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) social_connection_id: Mapped[int] = mapped_column(INTEGER, nullable=False) preference_key: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) preference_value: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) time_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) social_connection: Mapped['ArtistSocialConnections'] = relationship( 'ArtistSocialConnections', back_populates='artist_social_connection_preferences', init=False, ) class ArtistSocialPreferences(Base): __tablename__ = 'artist_social_preferences' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], name='FK_artist_social_preferences_artist_info', ), ForeignKeyConstraint( ['preference_id'], ['social_site_preferences.id'], name='FK_artist_social_preferences_preference', ), Index('FK_artist_social_preferences_artist_info', 'artist_id'), Index('FK_artist_social_preferences_preference', 'preference_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column(INTEGER, nullable=False) preference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) time_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='artist_social_preferences', init=False ) preference: Mapped['SocialSitePreferences'] = relationship( 'SocialSitePreferences', back_populates='artist_social_preferences', init=False ) class ArtistTourdateSocialReferences(Base): __tablename__ = 'artist_tourdate_social_references' __table_args__ = ( ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_tourdate_social_references_reference', ), Index('FK_artist_tourdate_social_references_reference', 'social_reference_id'), Index('FK_artist_tourdate_social_references_tourdate', 'tourdate_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) tourdate_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_tourdate_social_references', init=False, ) class ArtistVideoSocialReferences(Base): __tablename__ = 'artist_video_social_references' __table_args__ = ( ForeignKeyConstraint( ['social_reference_id'], ['social_references.id'], name='FK_artist_video_social_references_reference', ), Index('FK_artist_video_social_references_reference', 'social_reference_id'), Index('FK_artist_video_social_references_video', 'video_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) video_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference_id: Mapped[int] = mapped_column(INTEGER, nullable=False) social_reference: Mapped['SocialReferences'] = relationship( 'SocialReferences', back_populates='artist_video_social_references', init=False ) class BlacklistWords(Base): __tablename__ = 'blacklist_words' __table_args__ = ( ForeignKeyConstraint( ['added_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_blacklist_word_added_by', ), ForeignKeyConstraint( ['blacklist_reason_id'], ['blacklist_reasons.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='blacklist_word_backlist_reason_id', ), Index('FK_blacklist_word_added_by', 'added_by'), Index('FK_blacklist_word_backlist_reason_id', 'blacklist_reason_id'), Index('idx_word_blacklist_reason_id', 'word', 'blacklist_reason_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) word: Mapped[str] = mapped_column(String(240, 'utf8mb4_general_ci'), nullable=False) blacklist_reason_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key of blacklist_reasons table' ) added_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='OA User that added the Blacklist word' ) notes: Mapped[Optional[str]] = mapped_column( String(256, 'utf8mb4_general_ci'), comment='Blacklist notes for Blacklisted word', default=None, ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table', default=None ) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) added_by_identity: Mapped[Optional[str]] = mapped_column( String(36, 'utf8mb4_general_ci'), default=None ) orchadmin_users: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='blacklist_words', init=False ) blacklist_reason: Mapped['BlacklistReasons'] = relationship( 'BlacklistReasons', back_populates='blacklist_words', init=False ) class DmsGenreMapping(Base): __tablename__ = 'dms_genre_mapping' __table_args__ = ( ForeignKeyConstraint( ['dms_master_genre_id'], ['dms_master_genre.dms_master_genre_id'], name='Fk_dms_genre_mapping', ), ForeignKeyConstraint( ['orchard_subgenre_id'], ['subgenre.orchard_id'], name='FK_dms_genre_mapping_subgenre', ), Index('fk_dms_master_genre_idx', 'dms_master_genre_id'), Index( 'unique_orchardsubgenre_dmsmastergenre', 'orchard_subgenre_id', 'dms_master_genre_id', unique=True, ), ) dms_genre_mapping_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) orchard_subgenre_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment="Foreign key reference of 'subgenre' table." ) dms_master_genre_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Foreign key reference of 'dms_master_genre' table.", ) dms_master_genre: Mapped['DmsMasterGenre'] = relationship( 'DmsMasterGenre', back_populates='dms_genre_mapping', init=False ) orchard_subgenre: Mapped['Subgenre'] = relationship( 'Subgenre', back_populates='dms_genre_mapping', init=False ) class DmsMasterSubgenre(Base): __tablename__ = 'dms_master_subgenre' __table_args__ = ( ForeignKeyConstraint( ['dms_master_genre_id'], ['dms_master_genre.dms_master_genre_id'], name='FK_dms_master_subgenre', ), Index( 'unique_dmsmastergenre_subgenrename', 'dms_master_genre_id', 'dms_master_subgenre', unique=True, ), Index( 'unique_genreid_subgenrename_subgenrecode', 'dms_master_genre_id', 'dms_master_subgenre', 'subgenre_code', unique=True, ), ) dms_master_subgenre_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) dms_master_genre_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Foreign key reference of 'dms_master_genre' table.", ) dms_master_subgenre: Mapped[str] = mapped_column( String(80, 'utf8mb4_general_ci'), nullable=False, comment='Dms subgenre name.' ) subgenre_code: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) dms_master_genre: Mapped['DmsMasterGenre'] = relationship( 'DmsMasterGenre', back_populates='dms_master_subgenre', init=False ) dms_subgenre_mapping: Mapped[list['DmsSubgenreMapping']] = relationship( 'DmsSubgenreMapping', back_populates='dms_master_subgenre', init=False ) class ImportAssetDetail(Base): __tablename__ = 'import_asset_detail' __table_args__ = ( ForeignKeyConstraint( ['import_asset_id'], ['import_asset.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_import_asset_id', ), Index('FK_upload_request_detail', 'import_asset_id'), Index('track_id', 'track_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) import_asset_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to upload request table' ) upc: Mapped[int] = mapped_column(BigInteger, nullable=False) track_id: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) import_asset: Mapped['ImportAsset'] = relationship( 'ImportAsset', back_populates='import_asset_detail', init=False ) class LicensingReviewStatusChangeHistory(Base): __tablename__ = 'licensing_review_status_change_history' __table_args__ = ( ForeignKeyConstraint( ['licensing_review_id'], ['licensing_review_status.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_licensing_review_status_change_history', ), Index('FK_licensing_review_status_change_history', 'licensing_review_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) licensing_review_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[Optional[str]] = mapped_column( ENUM('open', 'approved', 'compulsory_sent', 'pending_disney_approval'), default=None, ) changed_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) change_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) licensing_review: Mapped['LicensingReviewStatus'] = relationship( 'LicensingReviewStatus', back_populates='licensing_review_status_change_history', init=False, ) class Message(Base): __tablename__ = 'message' __table_args__ = ( ForeignKeyConstraint( ['image_asset_id'], ['image_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_message_image_assets', ), Index('FK_message_image_assets', 'image_asset_id'), {'comment': 'Holds messages sent to labels.'}, ) message_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Auto increment primary key of message table.', autoincrement=True, init=False, ) subject: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Subject of the message.', ) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Date the message was added.' ) message_from: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, server_default=text("'The Orchard'"), comment="Message sender's name", ) message: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Body of the message.', default=None ) image_asset_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to image asset', default=None ) image_asset: Mapped[Optional['ImageAssets']] = relationship( 'ImageAssets', back_populates='message', init=False ) class OrchadminRolePermissions(Base): __tablename__ = 'orchadmin_role_permissions' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_permission_id'], ['orchadmin_permissions.orchadmin_permission_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_permissions_id', ), ForeignKeyConstraint( ['orchadmin_role_id'], ['orchadmin_roles.orchadmin_role_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_role_id', ), Index('FK_orchadmin_role_id', 'orchadmin_role_id'), Index( 'orchadmin_permission_role', 'orchadmin_permission_id', 'orchadmin_role_id', unique=True, ), {'comment': 'Intermediary table for many to many relationship which links'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) orchadmin_permission_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_permissions table.' ) orchadmin_role_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_roles table.', ) allow: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'") ) orchadmin_permission: Mapped['OrchadminPermissions'] = relationship( 'OrchadminPermissions', back_populates='orchadmin_role_permissions', init=False ) orchadmin_role: Mapped['OrchadminRoles'] = relationship( 'OrchadminRoles', back_populates='orchadmin_role_permissions', init=False ) class OrchadminUserSavedQueryCriteria(Base): __tablename__ = 'orchadmin_user_saved_query_criteria' __table_args__ = ( ForeignKeyConstraint( ['saved_query_id'], ['orchadmin_user_saved_query.saved_query_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_user_saved_query_criteria', ), Index('saved_query_id', 'saved_query_id'), {'comment': 'Holds all user specific saved criteria for saved records or '}, ) saved_query_criteria_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) saved_query_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to orchadmin_user_saved_query table.', ) criteria_name: Mapped[str] = mapped_column( String(60, 'utf8mb4_general_ci'), nullable=False, comment='Name of the criteria.', ) criteria_value: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False, comment='Value of the criteria.', ) saved_query: Mapped['OrchadminUserSavedQuery'] = relationship( 'OrchadminUserSavedQuery', back_populates='orchadmin_user_saved_query_criteria', init=False, ) class ReleasePaymentLog(Base): __tablename__ = 'release_payment_log' __table_args__ = ( ForeignKeyConstraint( ['currency'], ['currency.currency_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_payment_log_currency', ), ForeignKeyConstraint( ['manual_adjustment_id'], ['manual_adjustment.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_payment_log_manual_adjustment', ), Index('FK_release_payment_log_credit_card_log', 'credit_card_log_id'), Index('FK_release_payment_log_manual_adjustment', 'manual_adjustment_id'), Index('currency', 'currency'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BigInteger, nullable=False) currency: Mapped[str] = mapped_column( String(3, 'utf8mb4_general_ci'), nullable=False ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( Double(asdecimal=True), default=None ) feetype: Mapped[Optional[str]] = mapped_column( ENUM('onetime', 'subscription'), default=None ) payment_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) credit_card_log_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) manual_adjustment_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) result: Mapped[Optional[str]] = mapped_column(ENUM('fail', 'success'), default=None) currency_: Mapped['Currency'] = relationship( 'Currency', back_populates='release_payment_log', init=False ) manual_adjustment: Mapped[Optional['ManualAdjustment']] = relationship( 'ManualAdjustment', back_populates='release_payment_log', init=False ) class ReleasePricingTier(Base): __tablename__ = 'release_pricing_tier' __table_args__ = ( ForeignKeyConstraint( ['pricing_tier_id'], ['dms_pricing_tier.pricing_tier_id'], name='new_FK_release_dms_pricing_tier', ), Index('new_FK_release_dms_pricing_tier', 'pricing_tier_id'), Index('pricing_tier_id', 'pricing_tier_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column(BIGINT, nullable=False) pricing_tier_id: Mapped[int] = mapped_column(MEDIUMINT, nullable=False) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) added_by_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='User id of person who changed the pricing details.', default=None, ) added_by_user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'vend_contact'), comment="Type of ID entered in 'added_by_user_id' field i.e either 'oa' or 'vend_contact'.", default=None, ) pricing_tier: Mapped['DmsPricingTier'] = relationship( 'DmsPricingTier', back_populates='release_pricing_tier', init=False ) release_custom_pricing: Mapped[list['ReleaseCustomPricing']] = relationship( 'ReleaseCustomPricing', back_populates='release_pricing_tier', init=False ) release_pricing_tier_country: Mapped[list['ReleasePricingTierCountry']] = ( relationship( 'ReleasePricingTierCountry', back_populates='release_pricing_tier', init=False, ) ) class RightsAttributesSuggestionGenreSubgenreKeywords(Base): __tablename__ = 'rights_attributes_suggestion_genre_subgenre_keywords' __table_args__ = ( ForeignKeyConstraint( ['genre_id'], ['genre.genre_id'], name='FK_ra_genre_keywords_genre_id' ), ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], name='FK_ra_genre_keywords_rights_attribute_id', ), ForeignKeyConstraint( ['subgenre_id'], ['subgenre.orchard_id'], name='FK_ra_genre_keywords_subgenre_id', ), Index('FK_ra_genre_keywords_rights_attribute_id', 'rights_attribute_id'), Index('FK_ra_genre_keywords_subgenre_id', 'subgenre_id'), Index( 'UC_Genre_Subgenre_Rights_Attribute', 'genre_id', 'subgenre_id', 'rights_attribute_id', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) genre_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='The column represents genre id, but can be NULL which means any genre is applicable.', default=None, ) subgenre_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='The column represents subgenre id, but can be NULL which means any subgenre is applicable.', default=None, ) genre: Mapped[Optional['Genre']] = relationship( 'Genre', back_populates='rights_attributes_suggestion_genre_subgenre_keywords', init=False, ) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='rights_attributes_suggestion_genre_subgenre_keywords', init=False, ) subgenre: Mapped[Optional['Subgenre']] = relationship( 'Subgenre', back_populates='rights_attributes_suggestion_genre_subgenre_keywords', init=False, ) class SocialPublishQueue(Base): __tablename__ = 'social_publish_queue' __table_args__ = ( ForeignKeyConstraint( ['artist_social_connection_id'], ['artist_social_connections.id'], name='FK_social_publish_queue_connection', ), Index('FK_social_publish_queue_connection', 'artist_social_connection_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) artist_social_connection_id: Mapped[int] = mapped_column(INTEGER, nullable=False) action: Mapped[str] = mapped_column(ENUM('ADD', 'UPDATE', 'DELETE'), nullable=False) resource: Mapped[str] = mapped_column( ENUM('TOUR_DATE', 'PHOTO', 'PROFILE_PHOTO', 'BIO', 'VIDEO', 'NEWS'), nullable=False, ) method: Mapped[str] = mapped_column( ENUM('SINGLE', 'MULTIPLE', 'DAYOF'), nullable=False ) current_status: Mapped[str] = mapped_column( ENUM('QUEUED', 'PROCESSING', 'SUCCESS', 'FAILED_FIXABLE', 'FAILED_NOTFIXABLE'), nullable=False, server_default=text("'QUEUED'"), ) artist_social_connection: Mapped['ArtistSocialConnections'] = relationship( 'ArtistSocialConnections', back_populates='social_publish_queue', init=False ) social_publish_history: Mapped[list['SocialPublishHistory']] = relationship( 'SocialPublishHistory', back_populates='social_publish_queue', init=False ) social_publish_queue_resources: Mapped[list['SocialPublishQueueResources']] = ( relationship( 'SocialPublishQueueResources', back_populates='social_publish_queue', init=False, ) ) class StoreExceptionDetail(Base): __tablename__ = 'store_exception_detail' __table_args__ = ( ForeignKeyConstraint( ['store_exception_id'], ['store_exception.store_exception_id'], ondelete='CASCADE', onupdate='RESTRICT', name='store_exception_id_ibfk_1', ), Index('store_exception_id_ibfk_1', 'store_exception_id'), ) store_exception_detail_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) exception_id: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='This would be a value among product_id, participant_id, country_id, vendor_id or subaccount_id', ) distribution_type_ids: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Reference to distribution_features table, it would be a comma separated list of feature ids', ) store_exception_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key of store_exception table', default=None ) store_exception: Mapped[Optional['StoreException']] = relationship( 'StoreException', back_populates='store_exception_detail', init=False ) class TourDateOtherArtists(Base): __tablename__ = 'tour_date_other_artists' __table_args__ = ( ForeignKeyConstraint( ['tour_date_id'], ['tour_dates.id'], ondelete='CASCADE', onupdate='CASCADE', name='FK_tour_date_other_artists_id', ), Index('FK_tour_date_other_artists_id', 'tour_date_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) tour_date_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) tour_date: Mapped[Optional['TourDates']] = relationship( 'TourDates', back_populates='tour_date_other_artists', init=False ) class TourdateBuylinks(Base): __tablename__ = 'tourdate_buylinks' __table_args__ = ( ForeignKeyConstraint( ['site_id'], ['sites.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tourdate_buylinks_sites', ), ForeignKeyConstraint( ['tour_date_id'], ['tour_dates.id'], ondelete='CASCADE', onupdate='CASCADE', name='FK_tourdate_buylinks', ), Index('FK_tourdate_buylinks', 'tour_date_id'), Index('FK_tourdate_buylinks_sites', 'site_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) tour_date_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) site_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) site: Mapped[Optional['Sites']] = relationship( 'Sites', back_populates='tourdate_buylinks', init=False ) tour_date: Mapped[Optional['TourDates']] = relationship( 'TourDates', back_populates='tourdate_buylinks', init=False ) class TrackPricingTier(Base): __tablename__ = 'track_pricing_tier' __table_args__ = ( ForeignKeyConstraint( ['pricing_tier_id'], ['dms_pricing_tier.pricing_tier_id'], name='new_FK_track_dms_pricing_tier', ), Index('active', 'active'), Index('new_FK_track_dms_pricing_tier', 'pricing_tier_id'), Index('pricing_tier_id', 'pricing_tier_id'), Index('unique_track_id', 'unique_track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(BIGINT, nullable=False) pricing_tier_id: Mapped[int] = mapped_column(MEDIUMINT, nullable=False) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) added_by_user_id: Mapped[Optional[int]] = mapped_column( Integer, comment='User id of person who changed the pricing details.', default=None, ) added_by_user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'vend_contact'), comment="Type of ID entered in 'added_by_user_id' field i.e either 'oa' or 'vend_contact'.", default=None, ) pricing_tier: Mapped['DmsPricingTier'] = relationship( 'DmsPricingTier', back_populates='track_pricing_tier', init=False ) track_custom_pricing: Mapped[list['TrackCustomPricing']] = relationship( 'TrackCustomPricing', back_populates='track_pricing_tier', init=False ) track_pricing_tier_country: Mapped[list['TrackPricingTierCountry']] = relationship( 'TrackPricingTierCountry', back_populates='track_pricing_tier', init=False ) class Vendor(Base, UpdateMixin): __tablename__ = 'vendor' __table_args__ = ( ForeignKeyConstraint( ['assigned_reviewer'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_assigned_reviewer', ), ForeignKeyConstraint( ['assigned_to'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_assigned_to', ), ForeignKeyConstraint( ['company_brand_id'], ['company_brand.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_company_brand', ), ForeignKeyConstraint( ['last_modified_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_last_modified_by', ), ForeignKeyConstraint( ['quarterback_label_manager'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_quarterback_label_manager', ), ForeignKeyConstraint( ['wel_email_sender'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_wel_email_sender', ), Index('FK_vendor_api_vendor', 'api_vendor_id'), Index('FK_vendor_assigned_reviewer', 'assigned_reviewer'), Index('FK_vendor_company_brand', 'company_brand_id'), Index('FK_vendor_last_modified_by', 'last_modified_by'), Index('FK_vendor_quarterback_label_manager', 'quarterback_label_manager'), Index('FK_vendor_wel_email_sender', 'wel_email_sender'), Index('additional_id', 'additional_id'), Index('assigned_to', 'assigned_to'), Index('idx_vendor_uuid', 'vendor_uuid'), Index('index_isdistributor', 'is_distributor'), Index('login', 'login'), Index('owner', 'owner'), Index('status', 'status'), {'comment': 'Holds label information'}, ) vendor_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) is_distributor: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'N'") ) migrated_to_abacus: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'0'") ) company_brand_id: Mapped[int] = mapped_column(INTEGER, nullable=False) vendor_uuid: Mapped[str] = mapped_column(CHAR(36), nullable=False) allow_orchard_credit: Mapped[str] = mapped_column( ENUM('N', 'Y'), nullable=False, server_default=text("'N'"), comment='Determines whether or not label is allowed changes againt its orchard account.', ) first_statement_period: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'1'") ) sap_vendor_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Sony AP numerical 7-10 digit', default=None, ) name: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Contact name of the label.', default=None, ) company: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Company name of the label.', default=None, ) newsletter: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the label can be sent newsletter.', default=None, ) login: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), comment='Username for the label.', default=None, ) old_passwords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='deprecated', default=None ) bademail: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the label has bad email.', default=None, ) last_update: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the label is last updated.', default=None, ) passwords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Password for the label.', default=None, ) is_login_null: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), server_default=text("'no'"), comment='Yes or No indicates whether the login is null.', default=None, ) referral: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Referral information of the label.', default=None, ) join_vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor_tmp table.', default=None ) owner: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), server_default=text("'orchard'"), comment='Owner of the label.', default=None, ) priority: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'3'"), comment='Initial priority number of the label. Value can be 1, 2, 3, or 4.', default=None, ) region: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to region table.', default=None ) primary_genre: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Primary genre of the label. Foreign key to genre table.', default=None, ) est_total_releases: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Estimated number of releases from the label.', default=None ) est_total_tracks: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Estimated number of tracks from the label.', default=None ) date_created: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the label is created.', default=None ) overall_priority: Mapped[Optional[float]] = mapped_column( Float, comment='Overall priority number of the label.', default=None ) assigned_to: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user whom the label is assigned to.', default=None, ) status: Mapped[Optional[str]] = mapped_column( ENUM( 'pitched', 'pending', 'verbal', 'signed', 'passed', 'inactive', 'deletion', 'waiting_for_approval', 'approved', ), server_default=text("'signed'"), comment="Status of the label. Value can be 'pitched', 'pending', 'verbal', 'signed', 'passed', or 'inactive'.", default=None, ) website: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Website URL of the label.', default=None, ) ca_rep: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Content acqusition person assigned to this label. Foreign key to orchadmin_users table.', default=None, ) tax_form_received: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the tax form for the label is received.', default=None, ) w8_tax_form_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='W8 tax form date', default=None ) date_signed: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date when label status gets updated to signed.', default=None, ) payment_type: Mapped[Optional[str]] = mapped_column( ENUM('check', 'wire', 'travelex'), server_default=text("'check'"), comment='Payment type.', default=None, ) wire_info: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='Wire bank info.', default=None ) wel_email_sender: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Label Welcome email sent by', default=None ) wel_email_send_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Label Welcome email sent date and time', default=None, ) label_summary: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Label description', default=None ) myspace_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Label MySpace URL.', default=None ) additional_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='DRA ID', default=None ) monthly_accounting: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Flag indicates whether or not label requires monthly accounting.', default=None, ) original_owner: Mapped[Optional[str]] = mapped_column( ENUM('DRA', 'DMGI'), comment='Original owner of this label', default=None ) show_release_builder: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='checkbox on edit vendor page for showing/hidding release builder section in ALW', default=None, ) recurring_payment_threshold: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='Payment threshold as requested by label that must be surpassed for each check before it is cut', default=None, ) encrypted_tin: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment="Encrypted Vendor's tax id", default=None, ) checks: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Check payable', default=None ) tax_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) tax_id_type: Mapped[Optional[str]] = mapped_column( ENUM( '', 'corporation', 'individual', 'other', 'w9_individual', 'w9_c_corporation', 'w9_s_corporation', 'w9_partnership', 'w9_trust_estate', 'w9_llc', 'w8_corporation', 'w8_disregarded_entity', 'w8_partnership', 'w8_simple_trust', 'w8_grantor_trust', 'w8_complex_trust', 'w8_estate', 'w8_government', 'w8_central_bank_of_issue', 'w8_tax_exempt_organization', 'w8_private_foundation', 'w8_international_organization', 'w8_individual', 'w9_single_member_llc', 'w9_sole_proprietor', ), comment='Type of tax id', default=None, ) tax_id_country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table indicating country of tax id.', default=None, ) us_wht_treaty_opt_in: Mapped[Optional[int]] = mapped_column( TINYINT(1), default=None ) transfer_pricing_country: Mapped[Optional[str]] = mapped_column( ENUM( 'ioda_brazil', 'orchard_as', 'orchard_eu', 'orchard_gmbh', 'red_essential', 'sme_argentina', 'sme_australia', 'sme_austria', 'sme_belgium', 'sme_brazil', 'sme_canada', 'sme_central_america', 'sme_chile', 'sme_china', 'sme_colombia', 'sme_czech_republic', 'sme_denmark', 'sme_east_africa', 'sme_ecuador', 'sme_finland', 'sme_france', 'sme_germany', 'sme_greece', 'sme_hong_kong', 'sme_hungary', 'sme_india', 'sme_indonesia', 'sme_ireland', 'sme_israel', 'sme_italy', 'sme_korea', 'sme_malaysia', 'sme_mexico', 'sme_middle_east', 'sme_netherlands', 'sme_new_zealand', 'sme_norway', 'sme_peru', 'sme_philippines', 'sme_poland', 'sme_portugal', 'sme_russia', 'sme_singapore', 'sme_south_africa', 'sme_spain', 'sme_sweden', 'sme_switzerland', 'sme_taiwan', 'sme_thailand', 'sme_turkey', 'sme_united_kingdom', 'sme_uruguay', 'sme_venezuela', 'sme_vietnam', 'sme_west_africa', 'orchard_ny', 'finetunes', 'phonofile', 'fluve', ), default=None, ) w8_lob: Mapped[Optional[str]] = mapped_column( ENUM( 'government', 'tax_exempt_pension_trust_or_pension_fund', 'other_tax_exempt_organization', 'publicly_traded_corporation', 'subsidiary_of_a_publicly_traded_corporation', 'company_that_meets_the_ownership_and_base_erosion_test', 'company_that_meets_the_derivative_benefits_test', 'company_with_an_item_of_income_that_meets_active_trade_or_business_test', 'favorable_discretionary_determination_by_the_US_competent_authority_received', 'no_lob_article_in_treaty', 'not_a_W_8BEN_E_form', 'not_a_W_8BEN_E_form_or_no_tax_treaty', 'other', ), default=None, ) encrypted_foreign_tin: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment="Encrypted Vendor's foreign tax id", default=None, ) country: Mapped[Optional[int]] = mapped_column( SMALLINT, comment="Foreign key to country table. Vendor's country", default=None ) number_format: Mapped[Optional[str]] = mapped_column( ENUM('us', 'europe'), server_default=text("'us'"), default=None ) language: Mapped[Optional[str]] = mapped_column( ENUM('en', 'es', 'fr'), server_default=text("'en'"), comment='Language setting used for ALW', default=None, ) token: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), default=None ) api_vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key for api_vendors', default=None ) contact_email: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) label_identifier: Mapped[Optional[str]] = mapped_column( ENUM( 'Frontline', 'Client Services', 'Catalog', 'D3', 'Film', 'TV', 'Test', 'Accounting Only', ), default=None, ) is_owned: Mapped[Optional[str]] = mapped_column( ENUM('Yes', 'No'), server_default=text("'No'"), comment='Label is owner/operated by The Orchard or it is a client', default=None, ) support_contact_email: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Alternative email address to use as the support contact', default=None, ) quarterback_label_manager: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. ID of the orchadmin user whom the label is quarterback.', default=None, ) projected_first_year_revenue: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), comment='This is for the Projected 1st Year Revenue', default=None, ) external_identifier_1: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) external_identifier_2: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) external_identifier_3: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Used for sax migration to indicate if core or not core agreement', default=None, ) external_identifier_4: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Used for sax migration to indicate the entity (UK vs US)', default=None, ) assigned_reviewer: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. ID of the orchadmin user who is assigned reviewer.', default=None, ) relationship_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Notes about relationship managers', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) youtube_channel: Mapped[list['YoutubeChannel']] = relationship( 'YoutubeChannel', back_populates='vendor', init=False ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[assigned_reviewer], back_populates='vendor', init=False, ) orchadmin_users_: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[assigned_to], back_populates='vendor_', init=False, ) company_brand: Mapped['CompanyBrand'] = relationship( 'CompanyBrand', back_populates='vendor', init=False ) orchadmin_users1: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[last_modified_by], back_populates='vendor1', init=False, ) orchadmin_users2: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[quarterback_label_manager], back_populates='vendor2', init=False, ) orchadmin_users3: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[wel_email_sender], back_populates='vendor3', init=False, ) participant_identifier: Mapped[list['ParticipantIdentifier']] = relationship( 'ParticipantIdentifier', back_populates='vendor', init=False ) product_manager_mapping_vendor: Mapped[list['ProductManagerMappingVendor']] = ( relationship('ProductManagerMappingVendor', back_populates='vendor', init=False) ) product_territory_split: Mapped[list['ProductTerritorySplit']] = relationship( 'ProductTerritorySplit', back_populates='vendor', init=False ) rights_attributes_suggestion_vendor_imprint_keywords: Mapped[ list['RightsAttributesSuggestionVendorImprintKeywords'] ] = relationship( 'RightsAttributesSuggestionVendorImprintKeywords', back_populates='vendor', init=False, ) subaccount: Mapped[list['Subaccount']] = relationship( 'Subaccount', back_populates='vendor', init=False ) tv_series: Mapped[list['TvSeries']] = relationship( 'TvSeries', back_populates='vendor', init=False ) ugc_policy: Mapped[list['UgcPolicy']] = relationship( 'UgcPolicy', back_populates='vendor', init=False ) vendor_audio_attributes: Mapped[list['VendorAudioAttributes']] = relationship( 'VendorAudioAttributes', back_populates='vendor', init=False ) vendor_closers: Mapped[list['VendorClosers']] = relationship( 'VendorClosers', back_populates='vendor', init=False ) vendor_icon: Mapped[list['VendorIcon']] = relationship( 'VendorIcon', back_populates='vendor', init=False ) vendor_logo: Mapped[list['VendorLogo']] = relationship( 'VendorLogo', back_populates='vendor', init=False ) vendor_restricted_features: Mapped[list['VendorRestrictedFeatures']] = relationship( 'VendorRestrictedFeatures', back_populates='vendor', init=False ) vendor_rights_attributes: Mapped[list['VendorRightsAttributes']] = relationship( 'VendorRightsAttributes', back_populates='vendor', init=False ) youtube_audit: Mapped[list['YoutubeAudit']] = relationship( 'YoutubeAudit', back_populates='vendor', init=False ) catalog: Mapped[list['Catalog']] = relationship( 'Catalog', back_populates='vendor', init=False ) participant_external_link: Mapped[list['ParticipantExternalLink']] = relationship( 'ParticipantExternalLink', back_populates='vendor', init=False ) project_transfer_job: Mapped[list['ProjectTransferJob']] = relationship( 'ProjectTransferJob', foreign_keys='[ProjectTransferJob.destination_vendor_id]', back_populates='destination_vendor', init=False, ) project_transfer_job_: Mapped[list['ProjectTransferJob']] = relationship( 'ProjectTransferJob', foreign_keys='[ProjectTransferJob.originating_vendor_id]', back_populates='originating_vendor', init=False, ) rights_attributes_suggestion_vendor_subaccount_keywords: Mapped[ list['RightsAttributesSuggestionVendorSubaccountKeywords'] ] = relationship( 'RightsAttributesSuggestionVendorSubaccountKeywords', back_populates='vendor', init=False, ) soundscan_codes: Mapped[list['SoundscanCodes']] = relationship( 'SoundscanCodes', back_populates='vendor', init=False ) api_invoices: Mapped[list['ApiInvoices']] = relationship( 'ApiInvoices', back_populates='vendor', init=False ) marketplace_terms_and_conditions_history: Mapped[ list['MarketplaceTermsAndConditionsHistory'] ] = relationship( 'MarketplaceTermsAndConditionsHistory', back_populates='vendor', init=False ) welcome_email: Mapped[list['WelcomeEmail']] = relationship( 'WelcomeEmail', back_populates='vendor', init=False ) class VendorContractCompilation(Base): __tablename__ = 'vendor_contract_compilation' __table_args__ = ( ForeignKeyConstraint( ['vendor_contract_id'], ['vendor_contract.id'], ondelete='CASCADE', name='FK_vendor_contract_id', ), Index('vendor_contract_id', 'vendor_contract_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_contract_table' ) orchard_compilation_agreement: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates the agreement for Orchard Compilation.', default=None, ) orchard_compilation_split: Mapped[Optional[float]] = mapped_column( Float, comment='Orchard Compilation Split(Label Share).', default=None ) orchard_compilation_authorization_required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether Authorization Required for Orchard Compilation.', default=None, ) vendor_contract: Mapped['VendorContract'] = relationship( 'VendorContract', back_populates='vendor_contract_compilation', init=False ) class VendorContractDistributionType(Base): __tablename__ = 'vendor_contract_distribution_type' __table_args__ = ( ForeignKeyConstraint( ['vendor_contract_id'], ['vendor_contract.id'], ondelete='CASCADE', name='FK_vend_cont_id', ), Index( 'IDX_vend_cont_distro_type_id', 'vendor_contract_id', 'distribution_type_id', unique=True, ), {'comment': 'Holds distribution type allowed in the corresponding label c'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_contract_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) distribution_type_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Reference to distribution_type table.', default=None ) new_store_default: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Flag indicating default distribution type value when new store is added to the system', default=None, ) vendor_contract: Mapped[Optional['VendorContract']] = relationship( 'VendorContract', back_populates='vendor_contract_distribution_type', init=False ) class VendorProposedTermCompilation(Base): __tablename__ = 'vendor_proposed_term_compilation' __table_args__ = ( ForeignKeyConstraint( ['vendor_proposed_term_id'], ['vendor_proposed_term.vendor_proposed_term_id'], ondelete='CASCADE', name='FK_vendor_proposed_term_id', ), Index('vendor_proposed_term_id', 'vendor_proposed_term_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_proposed_term_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_proposed_term table' ) orchard_compilation_agreement: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates the agreement for Orchard Compilation.', default=None, ) orchard_compilation_split: Mapped[Optional[float]] = mapped_column( Float, comment='Orchard Compilation Split(Label Share).', default=None ) orchard_compilation_authorization_required: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether Authorization Required for Orchard Compilation.', default=None, ) vendor_proposed_term: Mapped['VendorProposedTerm'] = relationship( 'VendorProposedTerm', back_populates='vendor_proposed_term_compilation', init=False, ) class VendorTerritoryRestriction(Base): __tablename__ = 'vendor_territory_restriction' __table_args__ = ( ForeignKeyConstraint( ['vendor_contract_id'], ['vendor_contract.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_territory_restriction', ), Index('restriction_type', 'restriction_type'), Index('vendor_contract_id', 'vendor_contract_id'), Index( 'vendor_restriction', 'vendor_contract_id', 'restriction_type', unique=True ), {'comment': 'Holds Vendor territory restrictions'}, ) restriction_id: Mapped[int] = mapped_column( BIGINT, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_contract_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor_contract table' ) territory_restriction: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Territory restriction for vendor contract', default=None, ) restriction_type: Mapped[Optional[str]] = mapped_column( ENUM('digital', 'physical'), server_default=text("'physical'"), comment='Distribution type of the release. Values can be digital or physical', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Last update timestamp', default=None ) updated_by: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to orchadmin_users table', default=None ) vendor_contract: Mapped['VendorContract'] = relationship( 'VendorContract', back_populates='vendor_territory_restriction', init=False ) class VideoDashboardItemStatus(Base): __tablename__ = 'video_dashboard_item_status' __table_args__ = ( ForeignKeyConstraint( ['dashboard_item_id'], ['video_dashboard_item.dashboard_item_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dashboard_item', ), ForeignKeyConstraint( ['status_type_id'], ['video_dashboard_status.status_type_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dashboard_item_status', ), ForeignKeyConstraint( ['user_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_video_dashboard_item_status_user_id', ), Index('FK_dashboard_item', 'dashboard_item_id'), Index('FK_dashboard_item_status', 'status_type_id'), Index('FK_video_dashboard_item_status_user_id', 'user_id'), ) status_item_id: Mapped[int] = mapped_column( BigInteger, primary_key=True, autoincrement=True, init=False ) status_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) dashboard_item_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) status_type_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) user_comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) reason_type_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) start_time_code: Mapped[Optional[float]] = mapped_column(FLOAT(10, 3), default=None) end_time_code: Mapped[Optional[float]] = mapped_column(FLOAT(10, 3), default=None) user_name: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) dashboard_item: Mapped[Optional['VideoDashboardItem']] = relationship( 'VideoDashboardItem', back_populates='video_dashboard_item_status', init=False ) status_type: Mapped[Optional['VideoDashboardStatus']] = relationship( 'VideoDashboardStatus', back_populates='video_dashboard_item_status', init=False ) user: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='video_dashboard_item_status', init=False ) class YoutubeChannelVerify(Base): __tablename__ = 'youtube_channel_verify' __table_args__ = ( ForeignKeyConstraint( ['url_id'], ['artist_url.url_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_youtube_channel_verify_url_id', ), Index('FK_youtube_channel_verify_url_id', 'url_id', unique=True), Index('index_verified', 'verified'), ) youtube_channel_verify_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) url_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign Key to artist_url table.' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) verified: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'N'"), default=None ) url: Mapped['ArtistUrl'] = relationship( 'ArtistUrl', back_populates='youtube_channel_verify', init=False ) class DmsSubgenreMapping(Base): __tablename__ = 'dms_subgenre_mapping' __table_args__ = ( ForeignKeyConstraint( ['dms_master_subgenre_id'], ['dms_master_subgenre.dms_master_subgenre_id'], name='FK_dms_subgenre_master_mapping', ), ForeignKeyConstraint( ['orchard_subgenre_id'], ['subgenre.orchard_id'], name='FK_dms_Orchard_subgenre', ), Index('FK_dms_subgenre_master_mapping', 'dms_master_subgenre_id'), Index( 'unique_orchardsubgenre_dmsmastersubgenre', 'orchard_subgenre_id', 'dms_master_subgenre_id', unique=True, ), ) dms_subgenre_mapping_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) orchard_subgenre_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment="Foreign key reference of 'subgenre' table." ) dms_master_subgenre_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment="Foreign key reference of 'dms_master_subgenre' table.", ) dms_master_subgenre: Mapped['DmsMasterSubgenre'] = relationship( 'DmsMasterSubgenre', back_populates='dms_subgenre_mapping', init=False ) orchard_subgenre: Mapped['Subgenre'] = relationship( 'Subgenre', back_populates='dms_subgenre_mapping', init=False ) class ParticipantIdentifier(Base, CreateMixin): __tablename__ = 'participant_identifier' __table_args__ = ( ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='customer_master_master-foreign-key', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='vendor-foreign-key', ), Index('customer_master_master-foreign-key', 'store_id'), Index( 'vendor-subaccount-store-name-unique-composite-key', 'vendor_id', 'subaccount_id', 'store_id', 'orchard_artist_name_md5', unique=True, ), { 'comment': 'Map Orchard artists to their identifiers at stores we deliver to.' }, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key of this table.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Vendor Id from art_relations.vendor.vendor_id.', ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Subaccount Id from art_relations.subaccount.subaccount_id.', ) store_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Store Id from art_relations.customer_master_master.customer_master_master_id.', ) orchard_artist_name_md5: Mapped[str] = mapped_column( CHAR(32, 'utf8mb4_general_ci'), nullable=False, comment='MD5 hash of the orchard_artist_name column.', ) orchard_artist_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Artist name from art_relations.release_artist.artist_name, OR art_relations.track_artist.name, OR art_relations.artist_info.name. All leading and trailing whitespace is removed and all occurrences of 2 or more consecutive spaces within the string have been replaced with a single space.', ) store_artist_id: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Store Artist Id: The id that orchard_artist_name is given at store store_id.', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Timestamp of the last record update', ) created_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Created at', default=None, ) store: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='participant_identifier', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='participant_identifier', init=False ) class PaymentCalculatorVendor(Base): __tablename__ = 'payment_calculator_vendor' __table_args__ = ( ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='CASCADE', onupdate='RESTRICT', name='payment_calculator_vendor_ibfk_1', ), ) vendor_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) time_started: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) progress: Mapped[int] = mapped_column(TINYINT, nullable=False) error_message: Mapped[Optional[str]] = mapped_column( String(500, 'utf8mb4_unicode_ci'), default=None ) time_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) class ProductManagerMappingVendor(Base): __tablename__ = 'product_manager_mapping_vendor' __table_args__ = ( ForeignKeyConstraint( ['product_manager_id'], ['orchadmin_users.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_pmmv_product_manager_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_pmmv_vendor_id', ), Index('FK_pmmv_product_manager_id', 'product_manager_id'), Index('FK_pmmv_vendor_id', 'vendor_id', unique=True), ) product_manager_mapping_vendor_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table' ) product_manager_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) updated_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='updated at', ) product_manager: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='product_manager_mapping_vendor', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='product_manager_mapping_vendor', init=False ) class ProductTerritorySplit(Base): __tablename__ = 'product_territory_split' __table_args__ = ( ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='CASCADE', onupdate='CASCADE', name='fk_prod_terr_country', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='CASCADE', onupdate='CASCADE', name='fk_prod_terr_vendor', ), Index('fk_prod_terr_vendor', 'vendor_id'), Index('idx_country', 'country_id'), Index('uidx_prod_territory', 'product_id', 'country_id', unique=True), ) product_territory_split_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column(BigInteger, nullable=False) country_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) split_rate: Mapped[decimal.Decimal] = mapped_column(DECIMAL(4, 2), nullable=False) vendor_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) country: Mapped['Country'] = relationship( 'Country', back_populates='product_territory_split', init=False ) vendor: Mapped[Optional['Vendor']] = relationship( 'Vendor', back_populates='product_territory_split', init=False ) class ReleaseCustomPricing(Base): __tablename__ = 'release_custom_pricing' __table_args__ = ( ForeignKeyConstraint( ['release_pricing_tier_id'], ['release_pricing_tier.id'], name='new_FK_release_pricing_tier', ), Index('new_FK_release_pricing_tier', 'release_pricing_tier_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_pricing_tier_id: Mapped[int] = mapped_column(INTEGER, nullable=False) custom_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(8, 2), default=None ) currency_code: Mapped[Optional[str]] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), default=None ) release_pricing_tier: Mapped['ReleasePricingTier'] = relationship( 'ReleasePricingTier', back_populates='release_custom_pricing', init=False ) class ReleasePricingTierCountry(Base): __tablename__ = 'release_pricing_tier_country' __table_args__ = ( ForeignKeyConstraint( ['release_pricing_tier_id'], ['release_pricing_tier.id'], name='new_FK_release_pricing_tier_id', ), Index('new_FK_release_pricing_tier_id', 'release_pricing_tier_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_pricing_tier_id: Mapped[int] = mapped_column(INTEGER, nullable=False) country_id: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) release_pricing_tier: Mapped['ReleasePricingTier'] = relationship( 'ReleasePricingTier', back_populates='release_pricing_tier_country', init=False ) class RightsAttributesSuggestionVendorImprintKeywords(Base): __tablename__ = 'rights_attributes_suggestion_vendor_imprint_keywords' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], name='FK_ra_imprint_keywords_rights_attribute_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], name='FK_ra_imprint_keywords_attribute_v_id', ), Index('FK_ra_imprint_keywords_attribute_v_id', 'vendor_id'), Index( 'UC_Rights_Attribute_Vendor_ImprintKeyword', 'rights_attribute_id', 'vendor_id', 'imprint_keyword', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) imprint_keyword: Mapped[str] = mapped_column(String(256), nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='rights_attributes_suggestion_vendor_imprint_keywords', init=False, ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='rights_attributes_suggestion_vendor_imprint_keywords', init=False, ) class SocialPublishHistory(Base): __tablename__ = 'social_publish_history' __table_args__ = ( ForeignKeyConstraint( ['social_publish_queue_id'], ['social_publish_queue.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_social_publish_history_publish_queue', ), Index('FK_social_publish_history_publish_queue', 'social_publish_queue_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) social_publish_queue_id: Mapped[int] = mapped_column(INTEGER, nullable=False) result: Mapped[str] = mapped_column( ENUM('QUEUED', 'PROCESSING', 'SUCCESS', 'FAILED_FIXABLE', 'FAILED_NOTFIXABLE'), nullable=False, ) history_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) message: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) social_publish_queue: Mapped['SocialPublishQueue'] = relationship( 'SocialPublishQueue', back_populates='social_publish_history', init=False ) class SocialPublishQueueResources(Base): __tablename__ = 'social_publish_queue_resources' __table_args__ = ( ForeignKeyConstraint( ['social_publish_queue_id'], ['social_publish_queue.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_social_publish_queue_resources_publish_queue', ), Index( 'FK_social_publish_queue_resources_publish_queue', 'social_publish_queue_id' ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) social_publish_queue_id: Mapped[int] = mapped_column(INTEGER, nullable=False) resource_id: Mapped[int] = mapped_column(Integer, nullable=False) social_publish_queue: Mapped['SocialPublishQueue'] = relationship( 'SocialPublishQueue', back_populates='social_publish_queue_resources', init=False, ) class SoundscanVendorExclusion(Base): __tablename__ = 'soundscan_vendor_exclusion' __table_args__ = ( ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_ss_vendor_id', ), ) vendor_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) class Subaccount(Base): __tablename__ = 'subaccount' __table_args__ = ( ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_country', ), ForeignKeyConstraint( ['genre_id'], ['genre.genre_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_genre', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_vendor', ), Index('FK_subaccount_country', 'country_id'), Index('FK_subaccount_genre', 'genre_id'), Index('FK_subaccount_vendor', 'vendor_id'), Index('index_dateDeleted', 'date_deleted'), Index('index_subaccName', 'subaccount_name'), Index('unique_subaccount_uuid', 'subaccount_uuid', unique=True), ) subaccount_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign Key to vendor table.' ) subaccount_uuid: Mapped[str] = mapped_column(CHAR(36), nullable=False) subaccount_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Name of the subaccount.', ) commission_override: Mapped[float] = mapped_column( FLOAT, nullable=False, server_default=text("'1'") ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) subaccount_split_type: Mapped[str] = mapped_column( ENUM('Gross', 'Net'), nullable=False, server_default=text("'Net'") ) genre_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Primary genre of the label. Foreign key to genre table.', default=None, ) website_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) myspace_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) city: Mapped[Optional[str]] = mapped_column( String(60, 'utf8mb4_general_ci'), default=None ) state_province: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to state', default=None ) other_state: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) country_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to country table.', default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) date_deleted: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) country: Mapped[Optional['Country']] = relationship( 'Country', back_populates='subaccount', init=False ) genre: Mapped[Optional['Genre']] = relationship( 'Genre', back_populates='subaccount', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='subaccount', init=False ) carveout_change_subaccount: Mapped[list['CarveoutChangeSubaccount']] = relationship( 'CarveoutChangeSubaccount', back_populates='subaccount', init=False ) catalog: Mapped[list['Catalog']] = relationship( 'Catalog', back_populates='subaccount', init=False ) participant_external_link: Mapped[list['ParticipantExternalLink']] = relationship( 'ParticipantExternalLink', back_populates='subaccount', init=False ) project_transfer_job: Mapped[list['ProjectTransferJob']] = relationship( 'ProjectTransferJob', foreign_keys='[ProjectTransferJob.destination_subaccount_id]', back_populates='destination_subaccount', init=False, ) project_transfer_job_: Mapped[list['ProjectTransferJob']] = relationship( 'ProjectTransferJob', foreign_keys='[ProjectTransferJob.originating_subaccount_id]', back_populates='originating_subaccount', init=False, ) releases: Mapped[list['Releases']] = relationship( 'Releases', back_populates='subaccount', init=False ) rights_attributes_suggestion_vendor_subaccount_keywords: Mapped[ list['RightsAttributesSuggestionVendorSubaccountKeywords'] ] = relationship( 'RightsAttributesSuggestionVendorSubaccountKeywords', back_populates='subaccount', init=False, ) soundscan_codes: Mapped[list['SoundscanCodes']] = relationship( 'SoundscanCodes', back_populates='subaccount', init=False ) subaccount_dms_master_restriction: Mapped[ list['SubaccountDmsMasterRestriction'] ] = relationship( 'SubaccountDmsMasterRestriction', back_populates='subaccount', init=False ) subaccount_dms_restriction: Mapped[list['SubaccountDmsRestriction']] = relationship( 'SubaccountDmsRestriction', back_populates='subaccount', init=False ) subaccount_royalty_collection: Mapped[list['SubaccountRoyaltyCollection']] = ( relationship( 'SubaccountRoyaltyCollection', back_populates='subaccount', init=False ) ) subaccount_territory_restriction: Mapped[list['SubaccountTerritoryRestriction']] = ( relationship( 'SubaccountTerritoryRestriction', back_populates='subaccount', init=False ) ) vend_contact: Mapped[list['VendContact']] = relationship( 'VendContact', back_populates='subaccount', init=False ) class TestVendors(Base): __tablename__ = 'test_vendors' __table_args__ = ( ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='CASCADE', name='FK_test_vendors_vendor_id', ), ) vendor_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='primary key' ) class TrackCustomPricing(Base): __tablename__ = 'track_custom_pricing' __table_args__ = ( ForeignKeyConstraint( ['track_pricing_tier_id'], ['track_pricing_tier.id'], name='new_FK_track_pricing_tier', ), Index('new_FK_track_pricing_tier', 'track_pricing_tier_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_pricing_tier_id: Mapped[int] = mapped_column(INTEGER, nullable=False) custom_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(8, 2), default=None ) currency_code: Mapped[Optional[str]] = mapped_column( CHAR(3, 'utf8mb4_general_ci'), default=None ) track_pricing_tier: Mapped['TrackPricingTier'] = relationship( 'TrackPricingTier', back_populates='track_custom_pricing', init=False ) class TrackPricingTierCountry(Base): __tablename__ = 'track_pricing_tier_country' __table_args__ = ( ForeignKeyConstraint( ['track_pricing_tier_id'], ['track_pricing_tier.id'], name='new_FK_track_pricing_tier_id', ), Index('new_FK_track_pricing_tier_id', 'track_pricing_tier_id'), ) id: Mapped[int] = mapped_column( BIGINT, primary_key=True, autoincrement=True, init=False ) track_pricing_tier_id: Mapped[int] = mapped_column(INTEGER, nullable=False) country_id: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) track_pricing_tier: Mapped['TrackPricingTier'] = relationship( 'TrackPricingTier', back_populates='track_pricing_tier_country', init=False ) class TvSeries(Base): __tablename__ = 'tv_series' __table_args__ = ( ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tv_series_vendor_id', ), Index('vendor_id', 'vendor_id'), ) series_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) series_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name of the series.', default=None ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table.', default=None ) vendor: Mapped[Optional['Vendor']] = relationship( 'Vendor', back_populates='tv_series', init=False ) tv_series_artist_mapping: Mapped[list['TvSeriesArtistMapping']] = relationship( 'TvSeriesArtistMapping', back_populates='series', init=False ) class UgcPolicy(Base): __tablename__ = 'ugc_policy' __table_args__ = ( ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_ugc_policy', ), Index('unique_vendor_id', 'vendor_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to vendor table', default=None ) music_video_vendor: Mapped[Optional[str]] = mapped_column( ENUM('vevo', 'orchard'), server_default=text("'vevo'"), comment='Music video vendor', default=None, ) audio_match_policy: Mapped[Optional[str]] = mapped_column( ENUM('monetize', 'block'), server_default=text("'monetize'"), comment='Audio match policy', default=None, ) video_match_policy: Mapped[Optional[str]] = mapped_column( ENUM('monetize', 'block', 'dont_match'), server_default=text("'monetize'"), comment='Video match policy', default=None, ) video_upload_channel: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), server_default=text("'orchardmusic'"), comment='Video upload channel', default=None, ) video_upload_password: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), comment='Video upload password', default=None ) video_upload_policy: Mapped[Optional[str]] = mapped_column( ENUM('public', 'fingerprint_only'), server_default=text("'public'"), comment='Video upload policy', default=None, ) vendor: Mapped[Optional['Vendor']] = relationship( 'Vendor', back_populates='ugc_policy', init=False ) class VendorAudioAttributes(Base): __tablename__ = 'vendor_audio_attributes' __table_args__ = ( ForeignKeyConstraint( ['audio_attribute_id'], ['audio_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_audio_attributes_aa_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_audio_attributes_v_id', ), Index('FK_vendor_audio_attributes_aa_id', 'audio_attribute_id'), Index('UC_vendor_attribute', 'vendor_id', 'audio_attribute_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) audio_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) audio_attribute: Mapped['AudioAttributes'] = relationship( 'AudioAttributes', back_populates='vendor_audio_attributes', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_audio_attributes', init=False ) class VendorClosers(Base, UpdateMixin): __tablename__ = 'vendor_closers' __table_args__ = ( ForeignKeyConstraint( ['last_modified_by'], ['orchadmin_users.id'], ondelete='SET NULL', name='FK_vendor_closers_last_modified_by', ), ForeignKeyConstraint( ['orchadmin_user_id'], ['orchadmin_users.id'], ondelete='CASCADE', name='FK_vendor_closers_orchadmin_user_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='CASCADE', name='FK_vendor_closers_vendor_id', ), Index('FK_vendor_closers_last_modified_by', 'last_modified_by'), Index('FK_vendor_closers_orchadmin_user_id', 'orchadmin_user_id'), Index('FK_vendor_closers_vendor_id', 'vendor_id'), Index( 'orchadmin_user_id_vendor_id', 'orchadmin_user_id', 'vendor_id', unique=True ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table.' ) orchadmin_user_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table.' ) updated_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Timestamp of last update.', ) last_modified_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='ID of the orchadmin user who modified the record.', default=None, ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[last_modified_by], back_populates='vendor_closers', init=False, ) orchadmin_user: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', foreign_keys=[orchadmin_user_id], back_populates='vendor_closers_', init=False, ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_closers', init=False ) class VendorIcon(Base): __tablename__ = 'vendor_icon' __table_args__ = ( ForeignKeyConstraint( ['image_asset_id'], ['image_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_icon_image_assets', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_icon_vendor', ), Index('FK_vendor_icon_image_assets', 'image_asset_id'), Index('FK_vendor_icon_vendor', 'vendor_id'), ) vendor_icon_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) image_asset: Mapped['ImageAssets'] = relationship( 'ImageAssets', back_populates='vendor_icon', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_icon', init=False ) class VendorLogo(Base): __tablename__ = 'vendor_logo' __table_args__ = ( ForeignKeyConstraint( ['image_asset_id'], ['image_assets.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_logo_image_assets', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_logo_vendor', ), Index('FK_vendor_logo_image_assets', 'image_asset_id'), Index('FK_vendor_logo_vendor', 'vendor_id'), ) vendor_logo_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) image_asset_id: Mapped[int] = mapped_column(Integer, nullable=False) image_asset: Mapped['ImageAssets'] = relationship( 'ImageAssets', back_populates='vendor_logo', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_logo', init=False ) t_vendor_physical_supplychain_default_selection = Table( 'vendor_physical_supplychain_default_selection', Base.metadata, Column( 'vendor_id', INTEGER, nullable=False, comment='The provider name for this login' ), Column( 'store_id', SMALLINT, nullable=False, comment='Reference of customer master master.', ), Column( 'time_created', NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), ), ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_phys_for_store', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_phys_vendor', ), Index('store_id_phys_chain', 'store_id'), Index( 'vendor_id_store_id_unique_phys_supplychain', 'vendor_id', 'store_id', unique=True, ), ) class VendorRestrictedFeatures(Base, UpdateMixin): __tablename__ = 'vendor_restricted_features' __table_args__ = ( ForeignKeyConstraint( ['feature_id'], ['features.feature_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_feature_id_vendor_restricted_features', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_id_vendor_restricted_features', ), Index('FK_feature_id_vendor_restricted_features', 'feature_id'), Index('FK_vendor_id_vendor_restricted_features', 'vendor_id'), Index('unique_idx', 'vendor_restricted_features_id', unique=True), ) vendor_restricted_features_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Primary Key' ) vendor_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='FKey to vendor table' ) feature_id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='FKey to feature table' ) preview: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'0'") ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user that modified the record. Example: oa or alw', default=None, ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Id of user that modified the record. Example: orchadmin_users.id or vend_contact.id.', default=None, ) feature: Mapped['Features'] = relationship( 'Features', back_populates='vendor_restricted_features', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_restricted_features', init=False ) class VendorRightsAttributes(Base): __tablename__ = 'vendor_rights_attributes' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_rights_attributes_ra_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_rights_attributes_v_id', ), Index('FK_vendor_rights_attributes_ra_id', 'rights_attribute_id'), Index( 'UC_vendor_rights_attributes', 'vendor_id', 'rights_attribute_id', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='vendor_rights_attributes', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='vendor_rights_attributes', init=False ) class VendorServiceTier(Base, CreateMixin): __tablename__ = 'vendor_service_tier' __table_args__ = ( ForeignKeyConstraint( ['service_tier_uuid'], ['service_tier.uuid'], ondelete='RESTRICT', onupdate='RESTRICT', name='vendor_service_tier_service_tier_uuid', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='vendor_service_tier_vendor_id', ), Index('vendor_service_tier_service_tier_uuid', 'service_tier_uuid'), ) vendor_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) service_tier_uuid: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False ) last_modified_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) created_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) service_tier: Mapped['ServiceTier'] = relationship( 'ServiceTier', back_populates='vendor_service_tier', init=False ) class YoutubeAudit(Base): __tablename__ = 'youtube_audit' __table_args__ = ( ForeignKeyConstraint( ['initiated_by_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_yt_audit_orchadmin_user_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_yt_audit_vendor_id', ), Index('IDX_initiated_by_id', 'initiated_by_id'), Index('IDX_yt_audit_status', 'audit_status'), Index('IDX_yt_audit_vendor_id', 'vendor_id'), ) youtube_audit_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) report_location: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) initiated_by_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) audit_status: Mapped[Optional[str]] = mapped_column( ENUM('requested', 'in_progress', 'generating', 'complete', 'error'), server_default=text("'requested'"), default=None, ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) created_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) initiated_by: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='youtube_audit', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='youtube_audit', init=False ) youtube_audit_release: Mapped[list['YoutubeAuditRelease']] = relationship( 'YoutubeAuditRelease', back_populates='youtube_audit', init=False ) class CarveoutChangeSubaccount(Base): __tablename__ = 'carveout_change_subaccount' __table_args__ = ( ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], name='FK_carveout_change_subaccount_id', ), Index( 'sub_id_day_hour_min_UK', 'subaccount_id', 'day_added', 'hour_of_day', 'minute_of_day', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) subaccount_id: Mapped[int] = mapped_column(INTEGER, nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) day_added: Mapped[datetime.date] = mapped_column(NormalizedDate, nullable=False) hour_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) minute_of_day: Mapped[int] = mapped_column(SMALLINT, nullable=False) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='carveout_change_subaccount', init=False ) class Catalog(Base): __tablename__ = 'catalog' __table_args__ = ( ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_catalog_subaccount', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_catalog_vendor', ), Index('FK_catalog_subaccount', 'subaccount_id'), Index('FK_catalog_vendor', 'vendor_id'), Index( 'unique_catalognumber_vendor_subaccount', 'catalog_number', 'vendor_id', 'subaccount_id', unique=True, ), ) catalog_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to the vendor table' ) catalog_number: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Label-assigned identifier for grouping multiple releases as one', default=None, ) subaccount_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to the subaccount table', default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date the catalog entry was last updated', default=None, ) subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', back_populates='catalog', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='catalog', init=False ) class ParticipantExternalLink(Base, CreateMixin): __tablename__ = 'participant_external_link' __table_args__ = ( ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_participant_store_id', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_participant_subaccount_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_participant_vendor_id', ), Index('FK_participant_store_id', 'store_id'), Index('FK_participant_subaccount_id', 'subaccount_id'), Index('FK_participant_vendor_id', 'vendor_id'), ) participant_external_link_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) store_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) created_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, default=None ) subaccount_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) orchard_artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) store_artist_id: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) label_participant_id: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) store: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='participant_external_link', init=False ) subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', back_populates='participant_external_link', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='participant_external_link', init=False ) class ProjectTransferJob(Base, CreateMixin, SoftDeleteMixin): __tablename__ = 'project_transfer_job' __table_args__ = ( ForeignKeyConstraint( ['destination_subaccount_id'], ['subaccount.subaccount_id'], name='FK_project_transfer_job_destination_subaccount_id', ), ForeignKeyConstraint( ['destination_vendor_id'], ['vendor.vendor_id'], name='FK_project_transfer_job_destination_vendor_id', ), ForeignKeyConstraint( ['originating_subaccount_id'], ['subaccount.subaccount_id'], name='FK_project_transfer_job_originating_subaccount_id', ), ForeignKeyConstraint( ['originating_vendor_id'], ['vendor.vendor_id'], name='FK_project_transfer_job_originating_vendor_id', ), ForeignKeyConstraint( ['project_id'], ['project.project_id'], name='FK_project_transfer_job_project_id', ), Index( 'FK_project_transfer_job_destination_subaccount_id', 'destination_subaccount_id', ), Index('FK_project_transfer_job_destination_vendor_id', 'destination_vendor_id'), Index( 'FK_project_transfer_job_originating_subaccount_id', 'originating_subaccount_id', ), Index('FK_project_transfer_job_originating_vendor_id', 'originating_vendor_id'), Index('IDX_project_transfer_job_project_status', 'project_id', 'status'), ) job_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) project_id: Mapped[int] = mapped_column(BIGINT, nullable=False) originating_vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) destination_vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[str] = mapped_column( Enum('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED', 'DELETED'), nullable=False, server_default=text("'QUEUED'"), ) created_by_identity_id: Mapped[str] = mapped_column(CHAR(36), nullable=False) created_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), default=None, ) originating_subaccount_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) originating_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) destination_subaccount_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) destination_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) failure_reason: Mapped[Optional[str]] = mapped_column(Text, default=None) revenue_cutoff_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) transfer_completed_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) sfn_execution_arn: Mapped[Optional[str]] = mapped_column(String(512), default=None) last_updated_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) last_updated_by_identity_id: Mapped[Optional[str]] = mapped_column( CHAR(36), default=None ) executed_by_identity_id: Mapped[Optional[str]] = mapped_column( CHAR(36), default=None ) deleted_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) deleted_by_identity_id: Mapped[Optional[str]] = mapped_column( CHAR(36), default=None ) destination_subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', foreign_keys=[destination_subaccount_id], back_populates='project_transfer_job', init=False, ) destination_vendor: Mapped['Vendor'] = relationship( 'Vendor', foreign_keys=[destination_vendor_id], back_populates='project_transfer_job', init=False, ) originating_subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', foreign_keys=[originating_subaccount_id], back_populates='project_transfer_job_', init=False, ) originating_vendor: Mapped['Vendor'] = relationship( 'Vendor', foreign_keys=[originating_vendor_id], back_populates='project_transfer_job_', init=False, ) project: Mapped['Project'] = relationship( 'Project', back_populates='project_transfer_job', init=False ) product_transfer_history: Mapped[list['ProductTransferHistory']] = relationship( 'ProductTransferHistory', back_populates='job', init=False ) class Releases(Base): __tablename__ = 'releases' __table_args__ = ( ForeignKeyConstraint( ['distribution_format_id'], ['distribution_format.distribution_format_id'], name='FK_distribution_format_id', ), ForeignKeyConstraint( ['product_subtype_id'], ['product_subtype.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_product_subtype_id', ), ForeignKeyConstraint( ['product_type_id'], ['product_type.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_product_type_id', ), ForeignKeyConstraint( ['project_id'], ['project.project_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_project_id', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_subaccount', ), ForeignKeyConstraint( ['subtitle_language_id'], ['language.language_code'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subtitle_languauge_code', ), Index('FK_distribution_format_id', 'distribution_format_id'), Index('FK_releases_product_subtype_id', 'product_subtype_id'), Index('FK_releases_product_type_id', 'product_type_id'), Index('FK_releases_project_id', 'project_id'), Index('FK_releases_subaccount', 'subaccount_id'), Index('FK_subtitle_languauge_code', 'subtitle_language_id'), Index('additional_id', 'additional_id'), Index('artist_id', 'artist_id'), Index('date_added', 'date_added_REMOVE'), Index('display_upc', 'display_upc'), Index('genre_id', 'genre_id'), Index('ingestion_completed', 'ingestion_completed'), Index('int_mkt_manager', 'int_mkt_manager'), Index('last_updated', 'last_updated'), Index('manufacturer_upc', 'manufacturer_upc'), Index('product_code', 'product_code'), Index('release_name', 'release_name'), Index('upc', 'upc', unique=True), Index('vendor_catalog_number', 'vendor_catalog_number'), {'comment': 'Holds releases information which are in catalog'}, ) release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'"), comment='Primary key.' ) display: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='Yes or No indicates whether the release can be displayed.', ) deletions: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether the release is deleted.', ) distribution: Mapped[str] = mapped_column( ENUM('digital', 'phys/digital', 'ondemand'), nullable=False, server_default=text("'digital'"), comment="Distribution type of the release. Values can be digital' or 'phys/digital'.", ) release_status: Mapped[str] = mapped_column( ENUM( 'orchard_processing', 'label_confirmation', 'transfer_to_content', 'label_processing', 'in_content', ), nullable=False, server_default=text("'orchard_processing'"), ) project_id: Mapped[int] = mapped_column(BIGINT, nullable=False) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) display_upc: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='String version of UPC', default=None ) artist_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to artist_info table.', default=None ) subaccount_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to subaccount table.', default=None ) vendor_release_identifier: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), comment='Vendor Release ID', default=None ) release_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Release name.', default=None ) label: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Label/inprint information for the release.', default=None, ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Descriptive text of the release.', default=None, ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the release becomes digitally available to public.', default=None, ) listprice: Mapped[Optional[float]] = mapped_column( Float, comment='List price of the release.', default=None ) sellprice: Mapped[Optional[float]] = mapped_column( Float, comment='Sell price of the release.', default=None ) applfees: Mapped[Optional[float]] = mapped_column( Float, comment='Application fee number.', default=None ) referral_id: Mapped[Optional[str]] = mapped_column( String(35, 'utf8mb4_general_ci'), comment='Foreign key to referral table.', default=None, ) date_added_REMOVE: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) genre_id: Mapped[Optional[int]] = mapped_column( TINYINT, comment='Foreign key to genre table.', default=None ) format: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='Format of the release. CD, CD-R, etc.', default=None, ) distribution_format_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) orig_release_year: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Original release year of the release.', default=None ) promocode: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Promotion code.', default=None ) c_line: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Copyright information of the release.', default=None, ) manufacturer_upc: Mapped[Optional[str]] = mapped_column( VARCHAR(16), comment='Manufacturer UPC code of the release.', default=None ) album_download: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the release is allowed for album download.', default=None, ) download_price: Mapped[Optional[float]] = mapped_column( Float, comment='Price for the download of the release.', default=None ) priority: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'3'"), comment='Priority number. Value can be 1,2,3,4.', default=None, ) territory: Mapped[Optional[str]] = mapped_column( ENUM('worldwide', 'us_only', 'other'), default=None ) sale_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Street date of the release when it becomes avaialable for sale in stores.', default=None, ) vod_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) original_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Original release date of the release.', default=None ) vendor_catalog_number: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Label catalog number of the release.', default=None, ) language_id: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) promobox_no: Mapped[Optional[str]] = mapped_column( String(30, 'utf8mb4_general_ci'), comment='Promotion box number.', default=None ) additional_id: Mapped[Optional[int]] = mapped_column( Integer, comment='DRA ID', default=None ) dracatalog: Mapped[Optional[int]] = mapped_column( Integer, comment='DRA catalog number', default=None ) channel_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) product_type_id: Mapped[Optional[int]] = mapped_column( TINYINT, server_default=text("'1'"), default=None ) trackdown_black_list: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Indicates whether or not release is black listed for Trackdown.', default=None, ) not_for_distribution: Mapped[Optional[str]] = mapped_column( ENUM( 'AccountingDummy', 'TVSeasonAccountingDummy', 'CatalogDuplicate', 'EditoriallySuspectContent', 'YouTubeRemap', 'NotforFurtherDistribution', 'iTunesRingtone', 'N', 'LabelRCRevenueDummy', 'IncompleteAssets', 'PhysicalProduct', 'SwitchboardDummy', 'SMEAnalyticsDummy', 'MissingAssets', 'AWALNotOurDistribution', 'KNRAccountingDummy', 'ReviewedWontDeliver', 'BulkIngestInProgress', ), server_default=text("'N'"), default=None, ) europe_public_domain: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) karaoke: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) unknown_artist: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) new_release: Mapped[Optional[str]] = mapped_column( ENUM( 'New', 'Catalog', 'Reissue', 'Direct_To_Video', 'Sports', 'Slate', 'Non_Slate', 'Sports_Top_Tier', ), default=None, ) product_format: Mapped[Optional[str]] = mapped_column( ENUM('Single', 'EP', 'LP', 'Double LP', 'Boxset'), default=None ) product_code: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) special_instructions: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) promos_number: Mapped[Optional[int]] = mapped_column(Integer, default=None) promo_upc: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) sync_only: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) country_of_origin: Mapped[Optional[int]] = mapped_column(Integer, default=None) short_synopsis: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) keywords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) production_co: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) preorder_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, server_default=text("'1900-01-01'"), default=None ) amd_id: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) wholesale_price_tier: Mapped[Optional[str]] = mapped_column( String(100, 'utf8mb4_general_ci'), default=None ) season: Mapped[Optional[int]] = mapped_column(Integer, default=None) episode: Mapped[Optional[int]] = mapped_column(Integer, default=None) production_number: Mapped[Optional[int]] = mapped_column(Integer, default=None) network: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) genre_note: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) physical_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) theatrical_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) original_digital_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) est: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) vod: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) rsd_comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) int_mkt_manager: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) tms_id: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), default=None ) brand: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) digital_only: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) product_subtype_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) ingestion_completed: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) meta_language: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) itunes_previewable: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), default=None ) subtitle_language_id: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) compilation: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) p_line: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='p_line for product', default=None ) delivered_version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) distribution_format: Mapped[Optional['DistributionFormat']] = relationship( 'DistributionFormat', back_populates='releases', init=False ) product_subtype: Mapped[Optional['ProductSubtype']] = relationship( 'ProductSubtype', back_populates='releases', init=False ) product_type: Mapped[Optional['ProductType']] = relationship( 'ProductType', back_populates='releases', init=False ) project: Mapped['Project'] = relationship( 'Project', back_populates='releases', init=False ) subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', back_populates='releases', init=False ) subtitle_language: Mapped[Optional['Language']] = relationship( 'Language', back_populates='releases', init=False ) artist_services_assigned_release: Mapped[list['ArtistServicesAssignedRelease']] = ( relationship( 'ArtistServicesAssignedRelease', foreign_keys='[ArtistServicesAssignedRelease.release_id]', back_populates='release', init=False, ) ) artist_services_assigned_release_: Mapped[list['ArtistServicesAssignedRelease']] = ( relationship( 'ArtistServicesAssignedRelease', foreign_keys='[ArtistServicesAssignedRelease.upc]', back_populates='releases', init=False, ) ) concierge_product: Mapped[list['ConciergeProduct']] = relationship( 'ConciergeProduct', back_populates='product', init=False ) correction: Mapped[list['Correction']] = relationship( 'Correction', back_populates='releases', init=False ) dms_ingestion_failed: Mapped[list['DmsIngestionFailed']] = relationship( 'DmsIngestionFailed', back_populates='releases', init=False ) mkt_priority: Mapped[list['MktPriority']] = relationship( 'MktPriority', back_populates='release', init=False ) pitch_detail: Mapped[list['PitchDetail']] = relationship( 'PitchDetail', back_populates='releases', init=False ) product_distribution: Mapped[list['ProductDistribution']] = relationship( 'ProductDistribution', back_populates='product', init=False ) product_manager_mapping_product: Mapped[list['ProductManagerMappingProduct']] = ( relationship( 'ProductManagerMappingProduct', back_populates='release', init=False ) ) product_physical: Mapped[list['ProductPhysical']] = relationship( 'ProductPhysical', back_populates='release', init=False ) product_physical_change_history: Mapped[list['ProductPhysicalChangeHistory']] = ( relationship( 'ProductPhysicalChangeHistory', back_populates='product', init=False ) ) product_physical_supply_chain_metadata: Mapped[ list['ProductPhysicalSupplyChainMetadata'] ] = relationship( 'ProductPhysicalSupplyChainMetadata', back_populates='product', init=False ) product_provided_store_artists: Mapped[list['ProductProvidedStoreArtists']] = ( relationship( 'ProductProvidedStoreArtists', back_populates='release', init=False ) ) product_transfer_history: Mapped[list['ProductTransferHistory']] = relationship( 'ProductTransferHistory', back_populates='release', init=False ) product_video: Mapped[list['ProductVideo']] = relationship( 'ProductVideo', back_populates='release', init=False ) product_video_approval: Mapped[list['ProductVideoApproval']] = relationship( 'ProductVideoApproval', back_populates='release', init=False ) release_artist: Mapped[list['ReleaseArtist']] = relationship( 'ReleaseArtist', back_populates='release', init=False ) release_correction: Mapped[list['ReleaseCorrection']] = relationship( 'ReleaseCorrection', back_populates='release', init=False ) release_dms_restriction: Mapped[list['ReleaseDmsRestriction']] = relationship( 'ReleaseDmsRestriction', back_populates='release', init=False ) release_exclusive: Mapped[list['ReleaseExclusive']] = relationship( 'ReleaseExclusive', back_populates='releases', init=False ) release_film_genre: Mapped[list['ReleaseFilmGenre']] = relationship( 'ReleaseFilmGenre', back_populates='release', init=False ) release_localized_metadata: Mapped[list['ReleaseLocalizedMetadata']] = relationship( 'ReleaseLocalizedMetadata', back_populates='release', init=False ) release_logging: Mapped[list['ReleaseLogging']] = relationship( 'ReleaseLogging', back_populates='release', init=False ) release_manual_adjustment: Mapped[list['ReleaseManualAdjustment']] = relationship( 'ReleaseManualAdjustment', back_populates='release', init=False ) release_phonetic_translations: Mapped[list['ReleasePhoneticTranslations']] = ( relationship( 'ReleasePhoneticTranslations', back_populates='release', init=False ) ) release_subaccount_change_history: Mapped[ list['ReleaseSubaccountChangeHistory'] ] = relationship( 'ReleaseSubaccountChangeHistory', back_populates='release', init=False ) release_subgenre: Mapped[list['ReleaseSubgenre']] = relationship( 'ReleaseSubgenre', back_populates='release', init=False ) release_territory_restriction: Mapped[list['ReleaseTerritoryRestriction']] = ( relationship( 'ReleaseTerritoryRestriction', back_populates='release', init=False ) ) track: Mapped[list['Track']] = relationship( 'Track', back_populates='release', init=False ) youtube_audit_release: Mapped[list['YoutubeAuditRelease']] = relationship( 'YoutubeAuditRelease', back_populates='release', init=False ) focus_track: Mapped[list['FocusTrack']] = relationship( 'FocusTrack', back_populates='release', init=False ) release_approval_queue: Mapped[list['ReleaseApprovalQueue']] = relationship( 'ReleaseApprovalQueue', back_populates='release', init=False ) release_captions: Mapped[list['ReleaseCaptions']] = relationship( 'ReleaseCaptions', back_populates='release', init=False ) release_subtitles: Mapped[list['ReleaseSubtitles']] = relationship( 'ReleaseSubtitles', back_populates='release', init=False ) track_writer: Mapped[list['TrackWriter']] = relationship( 'TrackWriter', back_populates='releases', init=False ) youtube_channel_video_status: Mapped[list['YoutubeChannelVideoStatus']] = ( relationship('YoutubeChannelVideoStatus', back_populates='release', init=False) ) class RightsAttributesSuggestionVendorSubaccountKeywords(Base): __tablename__ = 'rights_attributes_suggestion_vendor_subaccount_keywords' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], name='FK_ra_vs_keywords_rights_attribute_id', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], name='FK_ra_vs_keywords_attribute_s_id', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], name='FK_ra_vs_keywords_attribute_v_id' ), Index('FK_ra_vs_keywords_attribute_s_id', 'subaccount_id'), Index('FK_ra_vs_keywords_attribute_v_id', 'vendor_id'), Index( 'UC_Rights_Attribute_Vendor_Subaccount', 'rights_attribute_id', 'vendor_id', 'subaccount_id', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) subaccount_id: Mapped[int] = mapped_column(INTEGER, nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='rights_attributes_suggestion_vendor_subaccount_keywords', init=False, ) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='rights_attributes_suggestion_vendor_subaccount_keywords', init=False, ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='rights_attributes_suggestion_vendor_subaccount_keywords', init=False, ) class SoundscanCodes(Base): __tablename__ = 'soundscan_codes' __table_args__ = ( ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_country', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_soundscan_codes', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor', ), Index('FK_country', 'country_id'), Index('FK_subaccount_soundscan_codes', 'subaccount_id'), Index('FK_vendor', 'vendor_id'), {'comment': 'Holds soundscan code information against vendors'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key of vendors table', default=None ) country_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key of country table', default=None ) soundscan_code: Mapped[Optional[str]] = mapped_column( String(4, 'utf8mb4_general_ci'), comment='Soundscan code', default=None ) subaccount_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) country: Mapped[Optional['Country']] = relationship( 'Country', back_populates='soundscan_codes', init=False ) subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', back_populates='soundscan_codes', init=False ) vendor: Mapped[Optional['Vendor']] = relationship( 'Vendor', back_populates='soundscan_codes', init=False ) class SoundscanSubaccountExclusion(Base): __tablename__ = 'soundscan_subaccount_exclusion' __table_args__ = ( ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_ss_sub_id', ), ) subaccount_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) class SubaccountDmsMasterRestriction(Base): __tablename__ = 'subaccount_dms_master_restriction' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_customer_master_master', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccoun_dms_master_restriction', ), Index('customer_master_master_id', 'customer_master_master_id'), Index('subaccount_id', 'subaccount_id'), Index('unique_key', 'customer_master_master_id', 'subaccount_id', unique=True), ) dms_master_restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) customer_master_master_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master_master table' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Last update timestamp', ) updated_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to subaccount table' ) customer_master_master: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='subaccount_dms_master_restriction', init=False, ) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='subaccount_dms_master_restriction', init=False ) class SubaccountDmsRestriction(Base): __tablename__ = 'subaccount_dms_restriction' __table_args__ = ( ForeignKeyConstraint( ['dms_id'], ['customer_master.customer_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_customer_master', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_dms_restriction', ), Index('dms_id', 'dms_id'), Index('subaccount_id', 'subaccount_id'), Index('unique_key', 'dms_id', 'subaccount_id', unique=True), ) dms_restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) dms_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Last update timestamp', ) updated_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to subaccount table' ) dms: Mapped['CustomerMaster'] = relationship( 'CustomerMaster', back_populates='subaccount_dms_restriction', init=False ) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='subaccount_dms_restriction', init=False ) class SubaccountRoyaltyCollection(Base): __tablename__ = 'subaccount_royalty_collection' __table_args__ = ( ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], name='FK_subaccount_royalty_collection_territories', ), Index('FK_subaccount_royalty_collection_territories', 'subaccount_id'), ) subaccount_royalty_collection_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key for subaccount_royalty_collection_territories', autoincrement=True, init=False, ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key reference of subaccount table' ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Define whether subaccount is active or not', default=None, ) start_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Start date defines date when subaccount become active', default=None, ) end_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='End date defines date when subaccount become inactive', default=None, ) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='subaccount_royalty_collection', init=False ) subaccount_royalty_collection_territories: Mapped[ list['SubaccountRoyaltyCollectionTerritories'] ] = relationship( 'SubaccountRoyaltyCollectionTerritories', back_populates='subaccount_royalty_collection', init=False, ) class SubaccountTerritoryRestriction(Base): __tablename__ = 'subaccount_territory_restriction' __table_args__ = ( ForeignKeyConstraint( ['country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_terrirtory_restriction_country', ), ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_subaccount_terrirtory_restriction', ), Index('country_id', 'country_id'), Index('subaccount_id', 'subaccount_id'), Index('unique_key', 'subaccount_id', 'country_id', unique=True), ) territory_restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to country table' ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Last update timestamp', ) updated_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) subaccount_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to subaccount table' ) country: Mapped['Country'] = relationship( 'Country', back_populates='subaccount_territory_restriction', init=False ) subaccount: Mapped['Subaccount'] = relationship( 'Subaccount', back_populates='subaccount_territory_restriction', init=False ) class TvSeriesArtistMapping(Base): __tablename__ = 'tv_series_artist_mapping' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tv_series_artist_mapping_artist_id', ), ForeignKeyConstraint( ['series_id'], ['tv_series.series_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_tv_series_artist_mapping_series_id', ), Index('artist_id', 'artist_id'), Index('series_id', 'series_id'), Index('unique_artist_id', 'artist_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) artist_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to artist_info table.' ) series_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to tv_series table.' ) date_created: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) artist: Mapped['ArtistInfo'] = relationship( 'ArtistInfo', back_populates='tv_series_artist_mapping', init=False ) series: Mapped['TvSeries'] = relationship( 'TvSeries', back_populates='tv_series_artist_mapping', init=False ) class VendContact(Base): __tablename__ = 'vend_contact' __table_args__ = ( ForeignKeyConstraint( ['subaccount_id'], ['subaccount.subaccount_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vend_contact_subaccount', ), Index('FK_vend_contact_subaccount', 'subaccount_id'), Index('auth0_user_id', 'auth0_user_id'), Index('contact_id', 'contact_id'), Index('idx_auth0_primary', 'auth0_user_id', 'auth0_primary', unique=True), Index('login', 'login', unique=True), Index('vendor_id', 'vendor_id', 'master'), {'comment': 'Links vendor and contact table'}, ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vendor table.', default=None ) contact_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to contact table.', default=None ) master: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or no indicates whether this is a primary contact for the label.', default=None, ) login: Mapped[Optional[str]] = mapped_column( String(254, 'utf8mb4_general_ci'), default=None ) old_passwords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) passwords: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language: Mapped[Optional[str]] = mapped_column( ENUM( 'en', 'es', 'fr', 'de', 'tr', 'it', 'ru', 'pt', 'ja', 'zh-TW', 'zh-CN', 'ko' ), server_default=text("'en'"), default=None, ) number_format: Mapped[Optional[str]] = mapped_column( ENUM('us', 'europe'), server_default=text("'us'"), default=None ) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) password_request_key: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='password request key', default=None ) password_reset_datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='datetime password request was made', default=None ) subaccount_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to subaccount table.', default=None ) auth0_user_id: Mapped[Optional[str]] = mapped_column( String(200, 'utf8mb4_general_ci'), default=None ) auth0_migration_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) auth0_primary: Mapped[Optional[str]] = mapped_column( ENUM('Y'), comment='Whether this is the primary account associated with the Auth0 user', default=None, ) subaccount: Mapped[Optional['Subaccount']] = relationship( 'Subaccount', back_populates='vend_contact', init=False ) api_invoices: Mapped[list['ApiInvoices']] = relationship( 'ApiInvoices', back_populates='vend_contact', init=False ) marketplace_terms_and_conditions_history: Mapped[ list['MarketplaceTermsAndConditionsHistory'] ] = relationship( 'MarketplaceTermsAndConditionsHistory', back_populates='vend_contact', init=False, ) vend_contact_roles: Mapped[list['VendContactRoles']] = relationship( 'VendContactRoles', back_populates='vend_contact', init=False ) vend_contact_roles_restored: Mapped[list['VendContactRolesRestored']] = ( relationship( 'VendContactRolesRestored', back_populates='vend_contact', init=False ) ) vendor_contact_preferences: Mapped[list['VendorContactPreferences']] = relationship( 'VendorContactPreferences', back_populates='vendor_contact', init=False ) welcome_email: Mapped[list['WelcomeEmail']] = relationship( 'WelcomeEmail', back_populates='vend_contact', init=False ) class ApiInvoices(Base): __tablename__ = 'api_invoices' __table_args__ = ( ForeignKeyConstraint( ['artist_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoices_artist_info', ), ForeignKeyConstraint( ['impersonated_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoices_oa_user', ), ForeignKeyConstraint( ['initiated_by'], ['vend_contact.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoices_vend_contact', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoices', ), Index('FK_api_invoices', 'vendor_id'), Index('FK_api_invoices_artist_info', 'artist_id'), Index('FK_api_invoices_oa_user', 'impersonated_by'), Index('FK_api_invoices_product_version', 'api_product_version_id'), Index('FK_api_invoices_vend_contact', 'initiated_by'), ) api_invoice_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) api_product_version_id: Mapped[int] = mapped_column(Integer, nullable=False) state: Mapped[str] = mapped_column( ENUM('received', 'paid'), nullable=False, server_default=text("'received'") ) received_date: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) paid_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) initiated_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) impersonated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) original_invoice_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) redirect_url: Mapped[Optional[str]] = mapped_column(MEDIUMTEXT, default=None) artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) application_order_id: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='api_invoices', init=False ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='api_invoices', init=False ) vend_contact: Mapped[Optional['VendContact']] = relationship( 'VendContact', back_populates='api_invoices', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='api_invoices', init=False ) api_invoice_details: Mapped[list['ApiInvoiceDetails']] = relationship( 'ApiInvoiceDetails', back_populates='api_invoice', init=False ) api_invoice_payment_logs: Mapped[list['ApiInvoicePaymentLogs']] = relationship( 'ApiInvoicePaymentLogs', back_populates='api_invoice', init=False ) class ArtistServicesAssignedRelease(Base): __tablename__ = 'artist_services_assigned_release' __table_args__ = ( ForeignKeyConstraint( ['orchadmin_users_id'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_services_user', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_services_release', ), ForeignKeyConstraint( ['upc'], ['releases.upc'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_artist_services_upc', ), Index('FK_artist_services_release', 'release_id'), Index('FK_artist_services_upc', 'upc'), Index('FK_artist_services_user', 'orchadmin_users_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases table' ) orchadmin_users_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) orchadmin_users: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='artist_services_assigned_release', init=False ) release: Mapped['Releases'] = relationship( 'Releases', foreign_keys=[release_id], back_populates='artist_services_assigned_release', init=False, ) releases: Mapped['Releases'] = relationship( 'Releases', foreign_keys=[upc], back_populates='artist_services_assigned_release_', init=False, ) class ConciergeProduct(Base): __tablename__ = 'concierge_product' __table_args__ = ( ForeignKeyConstraint( ['product_id'], ['releases.release_id'], ondelete='CASCADE', name='FK_product_id_releases', ), Index('FK_product_id_releases', 'product_id'), Index('uq_concierge_product_product_id', 'product_id', unique=True), ) concierge_product_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column(INTEGER, nullable=False) concierge_value: Mapped[str] = mapped_column( ENUM('yes', 'no'), nullable=False, server_default=text("'no'") ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) product: Mapped['Releases'] = relationship( 'Releases', back_populates='concierge_product', init=False ) class Correction(Base): __tablename__ = 'correction' __table_args__ = ( ForeignKeyConstraint( ['requested_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_requested_by', ), ForeignKeyConstraint( ['upc'], ['releases.upc'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_upc', ), Index('FK_requested_by', 'requested_by'), Index('upc', 'upc'), {'comment': 'Holds all error corrections information on releases in catal'}, ) correction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='Foreign key to releases table.', default=None ) correction: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Detailed text for the correction.', default=None, ) correction_type: Mapped[Optional[str]] = mapped_column( ENUM('digital', 'physical', 'phys/digital'), server_default=text("'digital'"), comment="Type of the correction. Values can be 'digital', 'physical', or 'phys/digital'.", default=None, ) requested_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user that requested this correction.', default=None, ) date_requested: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the correciton request is entered into OA.', default=None, ) correct_in_oa: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment="Yes or No indicates if it's correct in OA.", default=None, ) comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Request comment text if any.', default=None, ) resolved: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates if this correction has been resolved.', default=None, ) resolved_by: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to orchadmin_users table. Stores the ID of the orchadmin user who resolved this correction request.', default=None, ) date_resolved: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='Date the correction request is resolved.', default=None, ) resolved_comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), comment='Resolution comment text if any.', default=None, ) processing: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether correction is currently being processed.', default=None, ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='correction', init=False ) releases: Mapped[Optional['Releases']] = relationship( 'Releases', back_populates='correction', init=False ) class DmsIngestionFailed(Base): __tablename__ = 'dms_ingestion_failed' __table_args__ = ( ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_ingestion_failed_store_id', ), ForeignKeyConstraint( ['upc'], ['releases.upc'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_dms_ingestion_failed_upc', ), Index('FK_dms_ingestion_failed_store_id', 'store_id'), Index('fk_dms_ingestion_failed_upc', 'upc'), ) dms_ingestion_failed_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to upc column in releases table' ) store_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to customer_master_master_id column in customer_master_master table', ) date_reported: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Date the said UPC was reported that failed ingestion at DMS', default=None, ) store: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='dms_ingestion_failed', init=False ) releases: Mapped['Releases'] = relationship( 'Releases', back_populates='dms_ingestion_failed', init=False ) class MarketplaceTermsAndConditionsHistory(Base): __tablename__ = 'marketplace_terms_and_conditions_history' __table_args__ = ( ForeignKeyConstraint( ['terms_and_conditions_id'], ['marketplace_terms_conditions.terms_and_conditions_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_marketplace_terms_and_conditions_history', ), ForeignKeyConstraint( ['vend_contact_id'], ['vend_contact.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_marketplace_terms_and_conditions_history_vend_contact', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_marketplace_terms_and_conditions_history_vendor', ), Index('FK_marketplace_terms_and_conditions_history', 'terms_and_conditions_id'), Index( 'FK_marketplace_terms_and_conditions_history_vend_contact', 'vend_contact_id', ), Index('FK_marketplace_terms_and_conditions_history_vendor', 'vendor_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) terms_and_conditions_id: Mapped[int] = mapped_column(Integer, nullable=False) vendor_id: Mapped[int] = mapped_column(INTEGER, nullable=False) vend_contact_id: Mapped[int] = mapped_column(Integer, nullable=False) date_accepted: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) terms_and_conditions: Mapped['MarketplaceTermsConditions'] = relationship( 'MarketplaceTermsConditions', back_populates='marketplace_terms_and_conditions_history', init=False, ) vend_contact: Mapped['VendContact'] = relationship( 'VendContact', back_populates='marketplace_terms_and_conditions_history', init=False, ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='marketplace_terms_and_conditions_history', init=False ) class MktPriority(Base, CreateMixin): __tablename__ = 'mkt_priority' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releaseId', ), Index('FK_releaseId', 'release_id'), Index('priority', 'priority'), Index('type_id', 'country_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) priority: Mapped[str] = mapped_column( ENUM('a', 'b'), nullable=False, server_default=text("'b'"), comment='Marketing priority number of the release.', ) country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, server_default=text("'0'"), comment='Foreign key to country table.', ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) created_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) updated_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) release: Mapped['Releases'] = relationship( 'Releases', back_populates='mkt_priority', init=False ) class PitchDetail(Base): __tablename__ = 'pitch_detail' __table_args__ = ( ForeignKeyConstraint( ['pitch_id'], ['pitch.pitch_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_pitch_id', ), ForeignKeyConstraint( ['upc'], ['releases.upc'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_pitch_upc', ), Index('NewIndex1', 'upc'), Index('pitch_id', 'pitch_id'), {'comment': 'Stores pitch details for particular pitches'}, ) pitch_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key.', autoincrement=True, init=False, ) pitch_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'"), comment='Foreign key to pitch table.', ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'"), comment='Foreign key to releases table.', ) pitch: Mapped['Pitch'] = relationship( 'Pitch', back_populates='pitch_detail', init=False ) releases: Mapped['Releases'] = relationship( 'Releases', back_populates='pitch_detail', init=False ) class ProductDistribution(Base): __tablename__ = 'product_distribution' __table_args__ = ( ForeignKeyConstraint( ['distribute_to'], ['country.country_code'], ondelete='CASCADE', onupdate='RESTRICT', name='product_distribution_ibfk_2', ), ForeignKeyConstraint( ['product_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='product_distribution_ibfk_1', ), Index('distribute_to', 'distribute_to'), Index('product_id', 'product_id'), ) product_distribution_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases table' ) distribute_to: Mapped[str] = mapped_column( CHAR(2, 'utf8mb4_general_ci'), nullable=False, comment='Forign key of country.country_code ie. JP for JAPAN', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='Last update timestamp', ) updated_by: Mapped[Optional[int]] = mapped_column( Integer, comment='user_id who modified the product_distribution record', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw'), server_default=text("'oa'"), comment='Type of user oa or alw', default=None, ) country: Mapped['Country'] = relationship( 'Country', back_populates='product_distribution', init=False ) product: Mapped['Releases'] = relationship( 'Releases', back_populates='product_distribution', init=False ) class ProductManagerMappingProduct(Base): __tablename__ = 'product_manager_mapping_product' __table_args__ = ( ForeignKeyConstraint( ['product_manager_id'], ['orchadmin_users.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_pmmp_product_manager_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_pmmp_release_id', ), Index('FK_pmmp_product_manager_id', 'product_manager_id'), Index('FK_pmmp_release_id', 'release_id', unique=True), ) product_manager_mapping_product_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases table' ) product_manager_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table' ) updated_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='updated at', ) product_manager: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='product_manager_mapping_product', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_manager_mapping_product', init=False ) class ProductPhysical(Base): __tablename__ = 'product_physical' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_id', ), Index('FK_releases_id', 'release_id'), Index('release_id_unique', 'release_id', unique=True), {'comment': 'Holds physical products'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) pline: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Publishing information for the product.', ) packaging_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) exclusive_for: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) initial_stock: Mapped[Optional[int]] = mapped_column(Integer, default=None) box_lot: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) pricing: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(6, 2), default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) embargo_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) discount: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) individual: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) explicit: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) exportable: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) manufacturing_obligation: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Does this product have a manufacturing obligation?', default=None, ) units_per_set: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) wholesale_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(6, 2), default=None ) meeting_notes: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) hmv_notes: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) production_notes: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) display_configuration: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) japan_distribution: Mapped[Optional[str]] = mapped_column( ENUM('no', 'yes_only', 'yes_other'), server_default=text("'no'"), comment='Whether this product will be distributed to Japan only, to Japan and some other territories or not distributed to Japan', default=None, ) edition: Mapped[Optional[str]] = mapped_column( ENUM( 'normal_edition', 'first_run_limited_edition', 'initial_limited_edition', 'limited_edition', 'period_limited_edition', ), comment='The packaging edition for this product', default=None, ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_physical', init=False ) physical_order_targets: Mapped[list['PhysicalOrderTargets']] = relationship( 'PhysicalOrderTargets', back_populates='product', init=False ) class ProductPhysicalChangeHistory(Base): __tablename__ = 'product_physical_change_history' __table_args__ = ( ForeignKeyConstraint( ['product_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_product_id', ), Index('FK_product_id', 'product_id'), Index('date_changed_idx', 'date_changed'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) product_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='FK to releases.release_id' ) field_name: Mapped[str] = mapped_column( String(100, 'utf8mb4_general_ci'), nullable=False, comment='Name of field that changed', ) date_changed: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='Datetime when change occurred' ) old_price: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(6, 2), comment='Original product_physical.wholesale_price', default=None ) new_price: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='The price_code, could be 7.99 or LP12 or No Price Assigned, comes from pricing database, table product_store_effective_price_code', default=None, ) old_sale_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='Original releases.sale_start_date', default=None ) new_sale_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='New releases.sale_start_date', default=None ) old_deletion_status: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='Original releases.deletions', default=None ) new_deletion_status: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), comment='New releases.deletions', default=None ) old_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) new_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) old_embargo_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) new_embargo_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) delivered: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Processed for delivery', default=None, ) artworkpath: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) store_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='FK to customer_master_master.customer_master_master_id', default=None, ) product: Mapped['Releases'] = relationship( 'Releases', back_populates='product_physical_change_history', init=False ) class ProductPhysicalSupplyChainMetadata(Base): __tablename__ = 'product_physical_supply_chain_metadata' __table_args__ = ( ForeignKeyConstraint( ['product_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_product_id_idx', ), ForeignKeyConstraint( ['store_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_store_id_idx', ), Index('FK_product_id_idx', 'product_id'), Index('FK_store_id_idx', 'store_id'), { 'comment': 'This table holds supply chain metadata related to a physical ' 'product' }, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincrement Primary key.', autoincrement=True, init=False, ) product_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='releases.release_id or product_physical.release_id.', ) store_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='customer_master_master.customer_master_master_id.', ) is_deleted: Mapped[int] = mapped_column( TINYINT(1), nullable=False, server_default=text("'0'"), comment='Whether record is deleted', ) embargo_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) sale_start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) initial_stock: Mapped[Optional[int]] = mapped_column(Integer, default=None) date_added: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) added_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) date_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) updated_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) product: Mapped['Releases'] = relationship( 'Releases', back_populates='product_physical_supply_chain_metadata', init=False ) store: Mapped['CustomerMasterMaster'] = relationship( 'CustomerMasterMaster', back_populates='product_physical_supply_chain_metadata', init=False, ) class ProductProvidedStoreArtists(Base): __tablename__ = 'product_provided_store_artists' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_product_provided_store_artists_release_id', ), Index('FK_product_provided_store_artists_release_id', 'release_id'), ) product_provided_store_artists_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases table.' ) spotify: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes if product needs to deliver with create new artist to Spotify store', ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_provided_store_artists', init=False ) class ProductTransferHistory(Base, SoftDeleteMixin): __tablename__ = 'product_transfer_history' __table_args__ = ( ForeignKeyConstraint( ['destination_artist_id'], ['artist_info.artist_id'], ondelete='SET NULL', name='FK_product_transfer_history_destination_artist_id', ), ForeignKeyConstraint( ['job_id'], ['project_transfer_job.job_id'], name='FK_product_transfer_history_job_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], name='FK_product_transfer_history_release_id', ), ForeignKeyConstraint( ['source_artist_id'], ['artist_info.artist_id'], ondelete='SET NULL', name='FK_product_transfer_history_source_artist_id', ), Index( 'FK_product_transfer_history_destination_artist_id', 'destination_artist_id' ), Index('FK_product_transfer_history_release_id', 'release_id'), Index('FK_product_transfer_history_source_artist_id', 'source_artist_id'), Index('IDX_product_transfer_history_job_id', 'job_id'), Index( 'UQ_product_transfer_history_job_release', 'job_id', 'release_id', unique=True, ), ) product_transfer_history_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) job_id: Mapped[int] = mapped_column(INTEGER, nullable=False) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) source_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) destination_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) source_video_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) destination_video_artist_id: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) deleted_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) deleted_by_identity_id: Mapped[Optional[str]] = mapped_column( CHAR(36), default=None ) destination_artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', foreign_keys=[destination_artist_id], back_populates='product_transfer_history', init=False, ) job: Mapped['ProjectTransferJob'] = relationship( 'ProjectTransferJob', back_populates='product_transfer_history', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_transfer_history', init=False ) source_artist: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', foreign_keys=[source_artist_id], back_populates='product_transfer_history_', init=False, ) class ProductVideo(Base, CreateMixin): __tablename__ = 'product_video' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='product_video_ibfk_1', ), Index('idx_ingest_filename', 'ingest_filename'), Index('ingest_filename', 'ingest_filename', unique=True), Index('release_id', 'release_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) type_of_video: Mapped[Optional[str]] = mapped_column( ENUM( 'Official Music Video', 'Lyric Music Video', 'Pseudo Video', 'Behind the Scenes', 'Promo', 'Live Performance', 'Other', ), default=None, ) language_of_video_title: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) video_title: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) product_code: Mapped[Optional[str]] = mapped_column( String(128, 'utf8mb4_general_ci'), default=None ) upc: Mapped[Optional[int]] = mapped_column(BIGINT, default=None) isrc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), default=None ) imprint: Mapped[Optional[str]] = mapped_column( String(70, 'utf8mb4_general_ci'), default=None ) parental_advisory: Mapped[Optional[str]] = mapped_column( ENUM('No', 'Yes', 'Clean Version'), default=None ) language_of_video_content: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), default=None ) lyrics: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) c_line_year: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) c_line_copyright_holder: Mapped[Optional[str]] = mapped_column( String(251, 'utf8mb4_general_ci'), default=None ) p_line_year: Mapped[Optional[int]] = mapped_column(SmallInteger, default=None) p_line_copyright_holder: Mapped[Optional[str]] = mapped_column( String(251, 'utf8mb4_general_ci'), default=None ) new_release: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'1'"), default=None ) original_release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) release_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, default=None ) special_instructions: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) deliver_to_all: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'1'"), default=None ) genre_id: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) subgenre_id: Mapped[Optional[int]] = mapped_column(SMALLINT, default=None) contributors: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) keywords: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) primary_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) latest_pipeline_run_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) latest_approval_job_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) preview_start_time: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'15000'"), comment='The time at which the 30 seconds preview should start', default=None, ) thumbnail_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The path to the thumbnail (e.g. 123/0001.jpg)', default=None, ) thumbnail_at_milliseconds: Mapped[Optional[int]] = mapped_column( INTEGER, default=None ) channel_selection: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) not_for_distribution: Mapped[Optional[str]] = mapped_column( ENUM( 'AccountingDummy', 'TVSeasonAccountingDummy', 'CatalogDuplicate', 'EditoriallySuspectContent', 'YouTubeRemap', 'NotforFurtherDistribution', 'iTunesRingtone', 'N', 'LabelRCRevenueDummy', 'IncompleteAssets', 'PhysicalProduct', 'SwitchboardDummy', 'SMEAnalyticsDummy', 'MissingAssets', 'AWALNotOurDistribution', 'KNRAccountingDummy', ), server_default=text("'N'"), default=None, ) vevo_controlled: Mapped[Optional[str]] = mapped_column( ENUM('No', 'Yes'), default=None ) updated_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) submitted_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) youtube_only: Mapped[Optional[int]] = mapped_column( TINYINT(1), comment='Boolean value for whether user has chosen YouTube only disto option.', default=None, ) ingest_filename: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The name of the file that will be ingested.', default=None, ) custom_thumbnail_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='The path to the custom thumbnail (e.g. 123/custom.jpg)', default=None, ) migrated_metadata_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The datetime at which the metadata has been migrated for this product.', default=None, ) migrated_asset_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='The datetime at which the asset has been migrated for this product.', default=None, ) associated_track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Associated track.', default=None ) prores_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) h264_path: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) created_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_video', init=False ) class ProductVideoApproval(Base): __tablename__ = 'product_video_approval' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='product_video_approval_ibfk_1', ), Index('release_id', 'release_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) content_approved: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'0'"), default=None ) content_approved_by: Mapped[Optional[str]] = mapped_column( String(127, 'utf8mb4_general_ci'), default=None ) content_approved_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) release_approved: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'0'"), default=None ) release_approved_by: Mapped[Optional[str]] = mapped_column( String(127, 'utf8mb4_general_ci'), default=None ) release_approved_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) final_approved_by: Mapped[Optional[str]] = mapped_column( String(127, 'utf8mb4_general_ci'), default=None ) final_approved_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) rejection_reason: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) rejection_by: Mapped[Optional[str]] = mapped_column( String(127, 'utf8mb4_general_ci'), default=None ) rejection_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='product_video_approval', init=False ) class ReleaseArtist(Base): __tablename__ = 'release_artist' __table_args__ = ( ForeignKeyConstraint( ['artist_info_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_release_artist_to_artist_info', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_artist_release_id', ), Index('fk_release_artist_to_artist_info', 'artist_info_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), ) release_artist_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, server_default=text("'0'"), comment='Foreign key to release table.', ) role: Mapped[str] = mapped_column( String(25, 'utf8mb4_general_ci'), nullable=False, server_default=text("'performer'"), ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) artist_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Aritst name.' ) url: Mapped[Optional[str]] = mapped_column( String(156, 'utf8mb4_general_ci'), comment='URL of the artist profile.', default=None, ) artist_info_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist_info: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='release_artist', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_artist', init=False ) release_artist_localized_metadata: Mapped[ list['ReleaseArtistLocalizedMetadata'] ] = relationship( 'ReleaseArtistLocalizedMetadata', back_populates='release_artist', init=False ) class ReleaseCorrection(Base): __tablename__ = 'release_correction' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_correction_release', ), Index('FK_release_correction_release', 'release_id'), ) release_correction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[str] = mapped_column( ENUM('active', 'submitted', 'applied'), nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) last_updated_by: Mapped[int] = mapped_column(INTEGER, nullable=False) last_updated_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'vendor', 'system'), server_default=text("'vendor'"), comment='Type of user oa or vendor or system', default=None, ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_correction', init=False ) release_approval_queue: Mapped[list['ReleaseApprovalQueue']] = relationship( 'ReleaseApprovalQueue', back_populates='release_correction', init=False ) release_correction_detail: Mapped[list['ReleaseCorrectionDetail']] = relationship( 'ReleaseCorrectionDetail', back_populates='release_correction', init=False ) class ReleaseDmsRestriction(Base): __tablename__ = 'release_dms_restriction' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_release_dms_restriction', ), Index('dms_customer_id', 'dms_customer_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), Index('upc_dms', 'upc', 'dms_customer_id', unique=True), ) restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table' ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_dms_restriction', init=False ) class ReleaseExclusive(Base): __tablename__ = 'release_exclusive' __table_args__ = ( ForeignKeyConstraint( ['upc'], ['releases.upc'], onupdate='CASCADE', name='FK_release_exclusive_releases', ), Index('dms_customer_id', 'dms_customer_id'), Index('release_id', 'release_id'), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( MEDIUMINT, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to release table.' ) dms_customer_id: Mapped[int] = mapped_column( MEDIUMINT, nullable=False, comment='Foreign key to customer_master table.' ) sale_start_date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Street date of the release when it becomes avaialable for sale in stores.', ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) releases: Mapped['Releases'] = relationship( 'Releases', back_populates='release_exclusive', init=False ) class ReleaseFilmGenre(Base): __tablename__ = 'release_film_genre' __table_args__ = ( ForeignKeyConstraint( ['film_genre_id'], ['film_genre.film_genre_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_film_genre_film_genre_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_film_genre_release_id', ), Index('FK_release_film_genre_film_genre_id', 'film_genre_id'), Index('FK_release_film_genre_release_id', 'release_id'), ) release_film_genre_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) film_genre_id: Mapped[int] = mapped_column(Integer, nullable=False) is_primary: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) film_genre: Mapped['FilmGenre'] = relationship( 'FilmGenre', back_populates='release_film_genre', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_film_genre', init=False ) class ReleaseGrid(Base): __tablename__ = 'release_grid' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='release_grid_ibfk_1', ), Index('gras_status', 'gras_status'), Index('upc', 'upc'), ) release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='release identifier, matches releases.release_id', ) product_no: Mapped[str] = mapped_column( CHAR(14, 'utf8mb4_general_ci'), nullable=False, comment='Sony product number value', ) create_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='release identifier', default=None ) grid: Mapped[Optional[str]] = mapped_column( CHAR(18, 'utf8mb4_general_ci'), comment='GRid value, should be present for product numbers generated by Orchard', default=None, ) gras_status: Mapped[Optional[str]] = mapped_column( ENUM('unknown', 'incomplete', 'complete'), server_default=text("'unknown'"), default=None, ) class ReleaseLocalizedMetadata(Base): __tablename__ = 'release_localized_metadata' __table_args__ = ( ForeignKeyConstraint( ['language_id'], ['itunes_languages.language_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_language_id_itunes_lan', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', name='FK_release_id_release', ), Index('FK_language_id_itunes_lan', 'language_id'), Index('FK_release_id_release', 'release_id'), Index('IDX_release_name', 'release_name'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) language_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) release_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) delivered_version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language: Mapped[Optional['ItunesLanguages']] = relationship( 'ItunesLanguages', back_populates='release_localized_metadata', init=False ) release: Mapped[Optional['Releases']] = relationship( 'Releases', back_populates='release_localized_metadata', init=False ) class ReleaseLogging(Base): __tablename__ = 'release_logging' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases_logging_id', ), Index('FK_releases_logging_id', 'release_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) changed_by_type: Mapped[str] = mapped_column( ENUM('vendor', 'oa', 'system'), nullable=False, server_default=text("'system'") ) changed_by: Mapped[int] = mapped_column( Integer, nullable=False, server_default=text("'0'") ) updated_timestamp: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_logging', init=False ) class ReleaseManualAdjustment(Base, CreateMixin, UpdateMixin): __tablename__ = 'release_manual_adjustment' __table_args__ = ( ForeignKeyConstraint( ['category_id'], ['manual_adjustment_category.category_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_manual_adjustment_category', ), ForeignKeyConstraint( ['created_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_orchadmin_users', ), ForeignKeyConstraint( ['currencies_id'], ['currencies.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_currencies', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_releases', ), ForeignKeyConstraint( ['vendor_manual_adjustment_id'], ['manual_adjustment.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_manual_adjustment', ), Index('FK_currencies', 'currencies_id'), Index('FK_manual_adjustment', 'vendor_manual_adjustment_id'), Index('FK_manual_adjustment_category', 'category_id'), Index('FK_orchadmin_users', 'created_by'), Index('FK_releases', 'release_id'), {'comment': 'This table holds manual adjustments related to a release'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincrement Primary key.', autoincrement=True, init=False, ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, comment='The date manual adjustment was created.', ) category_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to the manual_adjustment_category table.', ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to the releases table.' ) amount: Mapped[decimal.Decimal] = mapped_column( DECIMAL(18, 6), nullable=False, comment='Amount for the manual adjustment.' ) currencies_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key of currencies table.' ) vendor_manual_adjustment_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key of vendor manual_adjustment table.', ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) created_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to orchadmin_users table indicates the user who entered the manual adjustment.', default=None, ) description: Mapped[Optional[str]] = mapped_column( MEDIUMTEXT, comment='This field holds the reason why the manual adjustment was entered.', default=None, ) user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), server_default=text("'system'"), comment='Type of user oa, alw or system', default=None, ) last_modified_by: Mapped[Optional[int]] = mapped_column( Integer, server_default=text("'179'"), comment='user_id who modified the release_manual_adjustment record.', default=None, ) category: Mapped['ManualAdjustmentCategory'] = relationship( 'ManualAdjustmentCategory', back_populates='release_manual_adjustment', init=False, ) orchadmin_users: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='release_manual_adjustment', init=False ) currencies: Mapped['Currencies'] = relationship( 'Currencies', back_populates='release_manual_adjustment', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_manual_adjustment', init=False ) vendor_manual_adjustment: Mapped['ManualAdjustment'] = relationship( 'ManualAdjustment', back_populates='release_manual_adjustment', init=False ) class ReleasePhoneticTranslations(Base, CreateMixin): __tablename__ = 'release_phonetic_translations' __table_args__ = ( ForeignKeyConstraint( ['language_id'], ['itunes_languages.language_id'], ondelete='CASCADE', onupdate='RESTRICT', name='release_phonetic_translations_ibfk_2', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='release_phonetic_translations_ibfk_1', ), Index('created_by', 'created_by'), Index('language_id', 'language_id'), Index('release_id', 'release_id'), Index('updated_by', 'updated_by'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) language_id: Mapped[int] = mapped_column(INTEGER, nullable=False) field_name: Mapped[str] = mapped_column( String(128, 'utf8mb4_general_ci'), nullable=False ) phonetic_translation: Mapped[str] = mapped_column( String(128, 'utf8mb4_general_ci'), nullable=False ) created_timestamp: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) updated_timestamp: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) updated_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) is_deleted: Mapped[Optional[int]] = mapped_column( TINYINT(1), server_default=text("'0'"), default=None ) created_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) language: Mapped['ItunesLanguages'] = relationship( 'ItunesLanguages', back_populates='release_phonetic_translations', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_phonetic_translations', init=False ) class ReleaseSpatial(Base, CreateMixin): __tablename__ = 'release_spatial' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', name='FK_release_spatial_release_id', ), Index('unique_upc', 'upc', unique=True), ) release_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Cross-table uniqueness with releases.upc enforced by trigger', ) updated_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) created_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) class ReleaseSubaccountChangeHistory(Base): __tablename__ = 'release_subaccount_change_history' __table_args__ = ( ForeignKeyConstraint( ['changed_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_subaccount_change_history_orchadmin_users', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_subaccount_change_history_releases', ), Index('FK_release_subaccount_change_history_orchadmin_users', 'changed_by'), Index('FK_release_subaccount_change_history_releases', 'release_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key of release table.' ) changed_by: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key of orchadmin_users table.' ) changed_on: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) description: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) orchadmin_users: Mapped['OrchadminUsers'] = relationship( 'OrchadminUsers', back_populates='release_subaccount_change_history', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_subaccount_change_history', init=False ) class ReleaseSubgenre(Base): __tablename__ = 'release_subgenre' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], name='FK_release_id' ), ForeignKeyConstraint( ['subgenre_id'], ['subgenre.orchard_id'], name='FK_subgenre_id' ), Index('FK_subgenre_id', 'subgenre_id'), Index('unique_release_id', 'release_id', unique=True), Index('upc', 'upc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) subgenre_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to subgenre table.' ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to release table.' ) upc: Mapped[Optional[int]] = mapped_column( BIGINT, comment='UPC value from releases table.', default=None ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_subgenre', init=False ) subgenre: Mapped['Subgenre'] = relationship( 'Subgenre', back_populates='release_subgenre', init=False ) class ReleaseTerritoryRestriction(Base): __tablename__ = 'release_territory_restriction' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='CASCADE', onupdate='RESTRICT', name='release_id', ), Index('country_id', 'country_id'), Index('release_id', 'release_id'), Index('upc_territory', 'upc', 'country_id', unique=True), ) restriction_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table' ) country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to country table' ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, server_default=text("'0'") ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_territory_restriction', init=False ) class SubaccountRoyaltyCollectionTerritories(Base): __tablename__ = 'subaccount_royalty_collection_territories' __table_args__ = ( ForeignKeyConstraint( ['subaccount_royalty_collection_id'], ['subaccount_royalty_collection.subaccount_royalty_collection_id'], name='FK_subaccount_royalty_collection', ), ForeignKeyConstraint( ['subaccount_royalty_collection_territory'], ['country.id'], name='FK_subaccount_royalty_collection_country', ), Index('FK_subaccount_royalty_collection', 'subaccount_royalty_collection_id'), Index( 'FK_subaccount_royalty_collection_country', 'subaccount_royalty_collection_territory', ), ) subaccount_royalty_collection_territories_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) subaccount_royalty_collection_territory: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment="Foreign key reference of 'country' table" ) subaccount_royalty_collection_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment="Foreign key reference of 'subaccount_royalty_collection' table", default=None, ) subaccount_royalty_collection: Mapped[Optional['SubaccountRoyaltyCollection']] = ( relationship( 'SubaccountRoyaltyCollection', back_populates='subaccount_royalty_collection_territories', init=False, ) ) country: Mapped['Country'] = relationship( 'Country', back_populates='subaccount_royalty_collection_territories', init=False, ) class Track(Base): __tablename__ = 'track' __table_args__ = ( ForeignKeyConstraint( ['closed_caption_reason_id'], ['closed_caption_reasons.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_closed_caption_reasons', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_release_id', ), Index('FK_closed_caption_reasons', 'closed_caption_reason_id'), Index('additional_id', 'additional_id'), Index('isrc', 'isrc'), Index('last_updated', 'last_updated'), Index('release_id', 'release_id'), Index('track_name', 'track_name'), Index('upc', 'upc', 'cd', 'track_id'), {'comment': 'Holds tracks that are already in catalog'}, ) sample: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Yes or No indicates whether this is a sample track.', ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) bonus: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'") ) youtube_matches: Mapped[str] = mapped_column( ENUM('Monetize', 'Don_t Monetize', 'Take Down'), nullable=False, server_default=text("'Monetize'"), comment='youtube matches dropdown in edit track page', ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) track_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Name/Title of the track.', default=None, ) upc: Mapped[Optional[int]] = mapped_column( BigInteger, comment='Foreign key to releases table.', default=None ) cd: Mapped[Optional[int]] = mapped_column( TINYINT, comment='CD volume number of the track.', default=None ) track_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Track number of the track.', default=None ) orchdmclip: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), default=None ) dmclips: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Demo clip of the track.', default=None, ) isrc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='ISRC code of the track.', default=None, ) length_minute: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Track length minute part.', default=None ) length_seconds: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Track length second part.', default=None ) writer: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Song writer of the track.', default=None, ) credit: Mapped[Optional[str]] = mapped_column( ENUM('orig_comp', 'another_comp'), server_default=text("'orig_comp'"), comment="Song writer credit. Value can be 'orig_comp' or 'another_comp'.", default=None, ) mechanical: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), server_default=text("'no'"), comment='Yes or No indicates whether the track is mechanical.', default=None, ) publisher: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Publisher of the track.', default=None, ) publish_company: Mapped[Optional[str]] = mapped_column( String(50, 'utf8mb4_general_ci'), comment='Performing rights organization.', default=None, ) dpd_license: Mapped[Optional[str]] = mapped_column( ENUM('yes', 'no'), server_default=text("'no'"), comment='Yes or No indicates whether the track has DPD license.', default=None, ) explicit_lyrics: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y', 'C'), server_default=text("'N'"), comment='Yes or No indicates whether the track has explicit lyrics.', default=None, ) version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Version of the track.', default=None ) purchasable: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment="Don't think it's still used.", default=None, ) download_price: Mapped[Optional[float]] = mapped_column( Float, comment='Retail track price.', default=None ) p_line: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='Phonogram right info of the track.', default=None, ) hidden: Mapped[Optional[str]] = mapped_column( ENUM('N', 'I', 'U', 'V'), comment='Yes or No indicates if the track is hidden.', default=None, ) offer_type: Mapped[Optional[str]] = mapped_column( ENUM( 'all', 'album_download_only', 'track_download_only', 'track_download_stream', 'album_track_download', 'album_download_stream', 'stream_only', 'none', ), server_default=text("'all'"), comment="Offer type of the track. Value can be 'all', 'album_download_only', 'track_download_only', 'track_download_stream', 'album_track_download', 'album_download_stream', 'stream_only', or 'none'.", default=None, ) dig_distribution_type: Mapped[Optional[str]] = mapped_column( ENUM('digital_mobile', 'digital_only', 'mobile_only'), server_default=text("'digital_mobile'"), comment="Digital distribution type of the track. Value can be 'digital_mobile', 'digital_only', or 'mobile_only'.", default=None, ) third_party_publisher: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the track has third party publisher.', default=None, ) royalty_collection: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the track is royalty collection', default=None, ) publishing_admin: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='Yes or No indicates whether the track is publishing admin', default=None, ) sync_admin: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), comment='Yes or No indicates whether the track is synchronization admin', default=None, ) additional_id: Mapped[Optional[int]] = mapped_column( Integer, comment='DRA ID', default=None ) track_type: Mapped[Optional[str]] = mapped_column( ENUM('music', 'video'), server_default=text("'music'"), comment='asset type', default=None, ) mp3_url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), comment='mp3 url field in edit track page', default=None, ) stereo_or_mono: Mapped[Optional[str]] = mapped_column( ENUM('stereo', 'mono', '5_1_surround'), default=None ) recommended: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), comment='recommended field in edit track page', default=None, ) youtube_uploads: Mapped[Optional[str]] = mapped_column( ENUM('Fingerprint Only', 'Public', 'Private'), default=None ) preorder_only: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'N'"), default=None ) original_file_name: Mapped[Optional[str]] = mapped_column( String(250, 'utf8mb4_general_ci'), default=None ) meta_language: Mapped[Optional[str]] = mapped_column( String(8, 'utf8mb4_general_ci'), comment='To store track audio language', default=None, ) preview_start_time: Mapped[Optional[int]] = mapped_column( Integer, comment='iTunes related meta information. Start time for preview clips.', default=None, ) closed_caption_exists: Mapped[Optional[int]] = mapped_column( TINYINT(1), default=None ) closed_caption_reason_id: Mapped[Optional[int]] = mapped_column( SmallInteger, default=None ) vendor_track_identifier: Mapped[Optional[str]] = mapped_column( String(32, 'utf8mb4_general_ci'), comment='Vendor Track ID', default=None ) recording_country: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Country Of Recording', default=None ) recording_year: Mapped[Optional[int]] = mapped_column( SmallInteger, comment='Year Of Recording', default=None ) original_track_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) us_publishing_obligation: Mapped[Optional[str]] = mapped_column( ENUM('Composition', 'ControlledByYourLabel', 'PublicDomain'), default=None ) closed_caption_reason: Mapped[Optional['ClosedCaptionReasons']] = relationship( 'ClosedCaptionReasons', back_populates='track', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='track', init=False ) dms_track_identifier: Mapped[list['DmsTrackIdentifier']] = relationship( 'DmsTrackIdentifier', back_populates='track', init=False ) focus_track: Mapped[list['FocusTrack']] = relationship( 'FocusTrack', back_populates='unique_track', init=False ) release_captions: Mapped[list['ReleaseCaptions']] = relationship( 'ReleaseCaptions', back_populates='track', init=False ) release_subtitles: Mapped[list['ReleaseSubtitles']] = relationship( 'ReleaseSubtitles', back_populates='track', init=False ) track_artist: Mapped[list['TrackArtist']] = relationship( 'TrackArtist', back_populates='track', init=False ) track_audio_attribute_suggestions: Mapped[ list['TrackAudioAttributeSuggestions'] ] = relationship( 'TrackAudioAttributeSuggestions', back_populates='unique_track', init=False ) track_audio_attributes: Mapped[list['TrackAudioAttributes']] = relationship( 'TrackAudioAttributes', back_populates='unique_track', init=False ) track_audio_attributes_changelog: Mapped[list['TrackAudioAttributesChangelog']] = ( relationship( 'TrackAudioAttributesChangelog', back_populates='unique_track', init=False ) ) track_audio_attributes_edits: Mapped[list['TrackAudioAttributesEdits']] = ( relationship( 'TrackAudioAttributesEdits', back_populates='unique_track', init=False ) ) track_credit: Mapped[list['TrackCredit']] = relationship( 'TrackCredit', back_populates='track', init=False ) track_instant_grat: Mapped[list['TrackInstantGrat']] = relationship( 'TrackInstantGrat', back_populates='unique_track', init=False ) track_localized_metadata: Mapped[list['TrackLocalizedMetadata']] = relationship( 'TrackLocalizedMetadata', back_populates='track', init=False ) track_master_rights: Mapped[list['TrackMasterRights']] = relationship( 'TrackMasterRights', back_populates='track', init=False ) track_physical: Mapped[list['TrackPhysical']] = relationship( 'TrackPhysical', back_populates='track', init=False ) track_producer_nationality: Mapped[list['TrackProducerNationality']] = relationship( 'TrackProducerNationality', back_populates='track', init=False ) track_publishing: Mapped[list['TrackPublishing']] = relationship( 'TrackPublishing', back_populates='track', init=False ) track_rights_attribute_suggestions: Mapped[ list['TrackRightsAttributeSuggestions'] ] = relationship( 'TrackRightsAttributeSuggestions', back_populates='unique_track', init=False ) track_rights_attributes: Mapped[list['TrackRightsAttributes']] = relationship( 'TrackRightsAttributes', back_populates='unique_track', init=False ) track_rights_attributes_changelog: Mapped[ list['TrackRightsAttributesChangelog'] ] = relationship( 'TrackRightsAttributesChangelog', back_populates='unique_track', init=False ) track_rights_attributes_edits: Mapped[list['TrackRightsAttributesEdits']] = ( relationship( 'TrackRightsAttributesEdits', back_populates='unique_track', init=False ) ) track_tag: Mapped[list['TrackTag']] = relationship( 'TrackTag', back_populates='track', init=False ) track_writer: Mapped[list['TrackWriter']] = relationship( 'TrackWriter', back_populates='unique_track', init=False ) youtube_channel_video_status: Mapped[list['YoutubeChannelVideoStatus']] = ( relationship('YoutubeChannelVideoStatus', back_populates='track', init=False) ) class VendContactRoles(Base): __tablename__ = 'vend_contact_roles' __table_args__ = ( ForeignKeyConstraint( ['role_id'], ['vendor_roles.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vend_contact_roles', ), ForeignKeyConstraint( ['vend_contact_id'], ['vend_contact.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_vend_contact_roles_vend_contact_id', ), Index('FK_vend_contact_roles', 'role_id'), Index('FK_vend_contact_roles_vend_contact_id', 'vend_contact_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) role_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_role id' ) vend_contact_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vend_contact id' ) role: Mapped['VendorRoles'] = relationship( 'VendorRoles', back_populates='vend_contact_roles', init=False ) vend_contact: Mapped['VendContact'] = relationship( 'VendContact', back_populates='vend_contact_roles', init=False ) class VendContactRolesRestored(Base): __tablename__ = 'vend_contact_roles_restored' __table_args__ = ( ForeignKeyConstraint( ['role_id'], ['vendor_roles.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vend_contact_roles_restored', ), ForeignKeyConstraint( ['vend_contact_id'], ['vend_contact.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_vend_contact_roles_restored_vend_contact_id', ), Index('FK_vend_contact_roles_restored', 'role_id'), Index('FK_vend_contact_roles_restored_vend_contact_id', 'vend_contact_id'), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) role_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vendor_role id' ) vend_contact_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to vend_contact id' ) role: Mapped['VendorRoles'] = relationship( 'VendorRoles', back_populates='vend_contact_roles_restored', init=False ) vend_contact: Mapped['VendContact'] = relationship( 'VendContact', back_populates='vend_contact_roles_restored', init=False ) class VendorContactPreferences(Base): __tablename__ = 'vendor_contact_preferences' __table_args__ = ( ForeignKeyConstraint( ['vendor_contact_id'], ['vend_contact.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_vendor_contact_preferences_vendor_contact_id', ), Index('FK_vendor_contact_preferences_vendor_contact_id', 'vendor_contact_id'), Index('unique_vendor_contact_id', 'vendor_contact_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) vendor_contact_id: Mapped[int] = mapped_column( Integer, nullable=False, comment='Foreign key to the vend_contact table' ) workstation_view: Mapped[str] = mapped_column( ENUM('Audio', 'Film', 'TV'), nullable=False, server_default=text("'Audio'"), comment='Workstation view option: Audio, Film or TV', ) vendor_contact: Mapped['VendContact'] = relationship( 'VendContact', back_populates='vendor_contact_preferences', init=False ) class WelcomeEmail(Base): __tablename__ = 'welcome_email' __table_args__ = ( ForeignKeyConstraint( ['vend_contact_id'], ['vend_contact.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vend_contact_welcome_email', ), ForeignKeyConstraint( ['vendor_id'], ['vendor.vendor_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_vendor_id', ), Index('FK_vend_contact_welcome_email', 'vend_contact_id'), Index('FK_vendor_id', 'vendor_id'), {'comment': 'Table contains history of status emails sent to labels regar'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) date: Mapped[datetime.date] = mapped_column( NormalizedDate, nullable=False, comment='Date of the welcome email.' ) vendor_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to vendor table.' ) email: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Email address where the welcome email should be sent to.', ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='Foreign key to releases table.' ) email_type: Mapped[str] = mapped_column( ENUM('receive_release', 'audio_master', 'artwork', 'label_copy_approval'), nullable=False, server_default=text("'receive_release'"), comment='Type of the email.', ) email_sent: Mapped[str] = mapped_column( ENUM('y', 'n', 'e'), nullable=False, server_default=text("'n'"), comment='Y indicates that email is sent, N indicates that email is not sent yet or eligible for re-try and E for error in sent Mail', ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key referencing ex_a_release' ) vend_contact_id: Mapped[Optional[int]] = mapped_column( Integer, comment='Foreign key to vend_contact table.', default=None ) vend_contact: Mapped[Optional['VendContact']] = relationship( 'VendContact', back_populates='welcome_email', init=False ) vendor: Mapped['Vendor'] = relationship( 'Vendor', back_populates='welcome_email', init=False ) class YoutubeAuditRelease(Base): __tablename__ = 'youtube_audit_release' __table_args__ = ( ForeignKeyConstraint( ['asset_cms_account_id'], ['youtube_channel_cms_account.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_yt_audit_cms_account_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_yt_audit_release_id', ), ForeignKeyConstraint( ['youtube_audit_id'], ['youtube_audit.youtube_audit_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_yt_audit_id', ), Index('IDX_yt_audit_id', 'youtube_audit_id'), Index('IDX_yt_audit_release_cmsa_id', 'asset_cms_account_id'), Index('IDX_yt_audit_release_id', 'release_id'), Index('IDX_yt_audit_release_status', 'audit_status'), ) youtube_audit_release_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) youtube_audit_id: Mapped[int] = mapped_column(INTEGER, nullable=False) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) asset_cms_account_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) is_cms_account_asset: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) is_youtube_asset: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), default=None ) num_assets: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) audit_status: Mapped[Optional[str]] = mapped_column( ENUM('pending', 'complete', 'error'), server_default=text("'pending'"), default=None, ) error: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) created_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) asset_cms_account: Mapped[Optional['YoutubeChannelCmsAccount']] = relationship( 'YoutubeChannelCmsAccount', back_populates='youtube_audit_release', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='youtube_audit_release', init=False ) youtube_audit: Mapped['YoutubeAudit'] = relationship( 'YoutubeAudit', back_populates='youtube_audit_release', init=False ) class ApiInvoiceDetails(Base): __tablename__ = 'api_invoice_details' __table_args__ = ( ForeignKeyConstraint( ['api_invoice_id'], ['api_invoices.api_invoice_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoice_details', ), Index('FK_api_invoice_details', 'api_invoice_id'), ) api_invoice_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) api_invoice_id: Mapped[int] = mapped_column(INTEGER, nullable=False) charge_type: Mapped[str] = mapped_column( ENUM('onetime', 'subscription', 'usage_based'), nullable=False, server_default=text("'onetime'"), ) product_type: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), default=None ) product_id: Mapped[Optional[int]] = mapped_column(BigInteger, default=None) description: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) frequency: Mapped[Optional[int]] = mapped_column(TINYINT, default=None) subscription_active: Mapped[Optional[str]] = mapped_column( ENUM('N', 'Y'), server_default=text("'Y'"), default=None ) due_date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) api_invoice: Mapped['ApiInvoices'] = relationship( 'ApiInvoices', back_populates='api_invoice_details', init=False ) class ApiInvoicePaymentLogs(Base): __tablename__ = 'api_invoice_payment_logs' __table_args__ = ( ForeignKeyConstraint( ['api_invoice_id'], ['api_invoices.api_invoice_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoice_payment_logs', ), ForeignKeyConstraint( ['currency'], ['currency.currency_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoice_payment_logs_currency', ), ForeignKeyConstraint( ['manual_adjustment_id'], ['manual_adjustment.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_api_invoice_payment_logs_manual_adjustment', ), Index('FK_api_invoice_payment_logs', 'api_invoice_id'), Index('FK_api_invoice_payment_logs_credit_card_log', 'credit_card_log_id'), Index('FK_api_invoice_payment_logs_currency', 'currency'), Index('FK_api_invoice_payment_logs_manual_adjustment', 'manual_adjustment_id'), ) api_invoice_payment_log_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) api_invoice_id: Mapped[int] = mapped_column(INTEGER, nullable=False) currency: Mapped[str] = mapped_column( String(3, 'utf8mb4_general_ci'), nullable=False ) credit_card_log_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) manual_adjustment_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) result: Mapped[Optional[str]] = mapped_column(ENUM('fail', 'success'), default=None) datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) amount: Mapped[Optional[decimal.Decimal]] = mapped_column( DECIMAL(18, 6), default=None ) api_invoice: Mapped['ApiInvoices'] = relationship( 'ApiInvoices', back_populates='api_invoice_payment_logs', init=False ) currency_: Mapped['Currency'] = relationship( 'Currency', back_populates='api_invoice_payment_logs', init=False ) manual_adjustment: Mapped[Optional['ManualAdjustment']] = relationship( 'ManualAdjustment', back_populates='api_invoice_payment_logs', init=False ) class DmsTrackIdentifier(Base): __tablename__ = 'dms_track_identifier' __table_args__ = ( ForeignKeyConstraint( ['dms_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_track_identifier', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_dms_track_identifier_track_id', ), Index('dms_master_master_id', 'dms_master_master_id'), Index('unique_key', 'track_id', 'dms_master_master_id', 'id_type', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Foreign key to track table', default=None ) dms_master_master_id: Mapped[Optional[int]] = mapped_column( SMALLINT, comment='Foreign key to customer_master_master table', default=None ) id_type: Mapped[Optional[str]] = mapped_column( ENUM('fingerprint_id', 'video_id'), comment='Type of DMS unique identifier', default=None, ) id_value: Mapped[Optional[str]] = mapped_column( String(25, 'utf8mb4_general_ci'), comment='Value of DMS unique identifier', default=None, ) dms_master_master: Mapped[Optional['CustomerMasterMaster']] = relationship( 'CustomerMasterMaster', back_populates='dms_track_identifier', init=False ) track: Mapped[Optional['Track']] = relationship( 'Track', back_populates='dms_track_identifier', init=False ) class FocusTrack(Base): __tablename__ = 'focus_track' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_focus_track_release_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_focus_track_unique_track_id', ), Index('FK_focus_track_release_id', 'release_id'), Index('FK_focus_track_unique_track_id', 'unique_track_id'), ) focus_track_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='track selected to be a focus track' ) release_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) start_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='day that track becomes the focus track', default=None ) end_date: Mapped[Optional[datetime.date]] = mapped_column( NormalizedDate, comment='day that track is no longer the focus track', default=None, ) updated_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) updated_by_user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) updated_by_user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw'), default=None ) created_on: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) created_by_user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) created_by_user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw'), default=None ) release: Mapped[Optional['Releases']] = relationship( 'Releases', back_populates='focus_track', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='focus_track', init=False ) class MasterGrid(Base): __tablename__ = 'master_grid' __table_args__ = ( ForeignKeyConstraint( ['id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='master_grid_ibfk_1', ), Index('IX_master_grid_isrc', 'isrc'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='track identifier, matches track.id' ) isrc: Mapped[str] = mapped_column( String(16, 'utf8mb4_general_ci'), nullable=False, comment='master identifier' ) product_no: Mapped[str] = mapped_column( CHAR(14, 'utf8mb4_general_ci'), nullable=False, comment='Sony product number value', ) create_time: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) grid: Mapped[Optional[str]] = mapped_column( CHAR(18, 'utf8mb4_general_ci'), comment='GRid value, should be present for product numbers generated by Orchard', default=None, ) class PhysicalOrderTargets(Base): __tablename__ = 'physical_order_targets' __table_args__ = ( ForeignKeyConstraint( ['product_id'], ['product_physical.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_physical_order_targets_physical_id', ), Index('FK_physical_order_targets_physical_id', 'product_id'), {'comment': 'Holds data for physical stock allocation'}, ) order_target_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) target: Mapped[int] = mapped_column(INTEGER, nullable=False) product_id: Mapped[int] = mapped_column(INTEGER, nullable=False) type: Mapped[Optional[str]] = mapped_column( ENUM('HMV', 'Indie', 'International'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) product: Mapped['ProductPhysical'] = relationship( 'ProductPhysical', back_populates='physical_order_targets', init=False ) class ReleaseApprovalQueue(Base): __tablename__ = 'release_approval_queue' __table_args__ = ( ForeignKeyConstraint( ['approved_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_approval_queue_approved_by', ), ForeignKeyConstraint( ['checked_out_by'], ['orchadmin_users.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_approval_queue_checked_out_by', ), ForeignKeyConstraint( ['release_correction_id'], ['release_correction.release_correction_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_approval_queue_release_correction', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_approval_queue_release', ), Index('FK_release_approval_queue_approved_by', 'approved_by'), Index('FK_release_approval_queue_checked_out_by', 'checked_out_by'), Index('FK_release_approval_queue_release', 'release_id'), Index('FK_release_approval_queue_release_correction', 'release_correction_id'), ) release_approval_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_id: Mapped[int] = mapped_column(INTEGER, nullable=False) status: Mapped[str] = mapped_column( ENUM('approved', 'checked_out', 'checked_in', 'rejected'), nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) date_submitted: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) initiate_errorcorrection: Mapped[int] = mapped_column( TINYINT, nullable=False, server_default=text("'0'") ) release_correction_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) checked_out_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) admin_approval: Mapped[Optional[str]] = mapped_column(ENUM('Y', 'N'), default=None) approved_by: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) submitted_by: Mapped[Optional[int]] = mapped_column(Integer, default=None) changed_by_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user that modified the record. Example: oa or alw', default=None, ) changed_by: Mapped[Optional[int]] = mapped_column( Integer, comment='Id of user that modified the record. Example: orchadmin_users.id or vend_contact.id.', default=None, ) orchadmin_users: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[approved_by], back_populates='release_approval_queue', init=False, ) orchadmin_users_: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', foreign_keys=[checked_out_by], back_populates='release_approval_queue_', init=False, ) release_correction: Mapped[Optional['ReleaseCorrection']] = relationship( 'ReleaseCorrection', back_populates='release_approval_queue', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_approval_queue', init=False ) rejection_notes: Mapped[list['RejectionNotes']] = relationship( 'RejectionNotes', back_populates='release_approval', init=False ) release_approval_comments: Mapped[list['ReleaseApprovalComments']] = relationship( 'ReleaseApprovalComments', back_populates='release_approval', init=False ) class ReleaseArtistLocalizedMetadata(Base): __tablename__ = 'release_artist_localized_metadata' __table_args__ = ( ForeignKeyConstraint( ['language_id'], ['itunes_languages.language_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_language_id_itunes_lan_ral', ), ForeignKeyConstraint( ['release_artist_id'], ['release_artist.release_artist_id'], ondelete='CASCADE', name='FK_release_artist_id_release_ral', ), Index('FK_language_id_itunes_lan_ral', 'language_id'), Index('FK_release_artist_id_release_ral', 'release_artist_id'), Index('IDX_artist_name', 'artist_name'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) language_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language: Mapped[Optional['ItunesLanguages']] = relationship( 'ItunesLanguages', back_populates='release_artist_localized_metadata', init=False, ) release_artist: Mapped[Optional['ReleaseArtist']] = relationship( 'ReleaseArtist', back_populates='release_artist_localized_metadata', init=False ) class ReleaseCaptions(Base): __tablename__ = 'release_captions' __table_args__ = ( ForeignKeyConstraint( ['import_asset_id'], ['import_asset.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_captions_import_asset_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_captions', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_captions', ), Index('FK_release_captions', 'release_id'), Index('FK_release_captions_import_asset_id', 'import_asset_id'), Index('FK_track_captions', 'track_id'), Index('release_captions_release_id_index', 'release_id'), Index('release_captions_track_id_index', 'track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key for release_captions', autoincrement=True, init=False, ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases' ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track' ) import_asset_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to import_asset' ) status: Mapped[str] = mapped_column( ENUM('new', 'deleted'), nullable=False, server_default=text("'new'"), comment='Status flag for closed_caption', ) file_type: Mapped[str] = mapped_column( ENUM('scc'), nullable=False, comment='Caption file can be of type "scc"' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='When this row was last updated.', default=None, ) import_asset: Mapped['ImportAsset'] = relationship( 'ImportAsset', back_populates='release_captions', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_captions', init=False ) track: Mapped['Track'] = relationship( 'Track', back_populates='release_captions', init=False ) class ReleaseCorrectionDetail(Base): __tablename__ = 'release_correction_detail' __table_args__ = ( ForeignKeyConstraint( ['release_correction_id'], ['release_correction.release_correction_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_correction_detail_release_correction', ), Index( 'FK_release_correction_detail_release_correction', 'release_correction_id' ), ) release_correction_detail_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) table_name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False ) key_value: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) last_updated: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) last_updated_by: Mapped[int] = mapped_column(INTEGER, nullable=False) release_correction_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) field_name: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) key_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) last_updated_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'vendor'), default=None ) release_correction: Mapped[Optional['ReleaseCorrection']] = relationship( 'ReleaseCorrection', back_populates='release_correction_detail', init=False ) class ReleaseSubtitles(Base): __tablename__ = 'release_subtitles' __table_args__ = ( ForeignKeyConstraint( ['import_asset_id'], ['import_asset.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_subtitles_import_asset_id', ), ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_subtitles_release_id', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_subtitles_track_id', ), Index('FK_release_subtitles', 'release_id'), Index('FK_release_subtitles_import_asset_id', 'import_asset_id'), Index('release_subtitles_release_id_index', 'release_id'), Index('release_subtitles_track_id_index', 'track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key for release_subtitles', autoincrement=True, init=False, ) release_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to releases' ) import_asset_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to import_asset' ) forced_subtitles: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'N'"), comment='Forced subtitles flag', ) file_type: Mapped[str] = mapped_column( ENUM('itt', 'srt'), nullable=False, comment='Subtitle file can be of "itt" and "srt" type', ) language_tag: Mapped[str] = mapped_column( String(40, 'utf8mb4_general_ci'), nullable=False, comment='Language tag' ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track' ) status: Mapped[str] = mapped_column( ENUM('new', 'deleted'), nullable=False, comment='Status flag for subtitles' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='When this row was last updated.', default=None, ) subtitle_type: Mapped[Optional[str]] = mapped_column( ENUM('feature', 'trailer'), server_default=text("'feature'"), comment='Type for iTunes delivery', default=None, ) import_asset: Mapped['ImportAsset'] = relationship( 'ImportAsset', back_populates='release_subtitles', init=False ) release: Mapped['Releases'] = relationship( 'Releases', back_populates='release_subtitles', init=False ) track: Mapped['Track'] = relationship( 'Track', back_populates='release_subtitles', init=False ) class TrackArtist(Base): __tablename__ = 'track_artist' __table_args__ = ( ForeignKeyConstraint( ['artist_info_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_track_artist_to_artist_info', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_artist', ), Index('fk_track_artist_to_artist_info', 'artist_info_id'), Index('track_id', 'track_id'), {'comment': 'Holds track artists of tracks that are already in catalog'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key.', autoincrement=True, init=False, ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track table.' ) type: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, server_default=text("'performer'"), comment='Type of track artist.', ) name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Name of track artist.', ) artist_info_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist_info: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='track_artist', init=False ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_artist', init=False ) track_artist_localized_metadata: Mapped[list['TrackArtistLocalizedMetadata']] = ( relationship( 'TrackArtistLocalizedMetadata', back_populates='track_artist', init=False ) ) class TrackAudioAttributeSuggestions(Base): __tablename__ = 'track_audio_attribute_suggestions' __table_args__ = ( ForeignKeyConstraint( ['unique_track_id'], ['track.id'], name='FK_track_audio_attribute_suggestions_track', ), Index('FK_track_audio_attribute_suggestions_track', 'unique_track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) user_uuid: Mapped[str] = mapped_column(CHAR(36), nullable=False) suggested_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) review_queue_id: Mapped[int] = mapped_column(INTEGER, nullable=False) suggestions: Mapped[dict] = mapped_column(JSON, nullable=False) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_audio_attribute_suggestions', init=False ) class TrackAudioAttributes(Base): __tablename__ = 'track_audio_attributes' __table_args__ = ( ForeignKeyConstraint( ['audio_attribute_id'], ['audio_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_audio_attribute_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_unique_id', ), Index('FK_audio_attribute_id', 'audio_attribute_id'), Index( 'UC_Track_Attribute', 'unique_track_id', 'audio_attribute_id', unique=True ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) audio_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) audio_attribute: Mapped['AudioAttributes'] = relationship( 'AudioAttributes', back_populates='track_audio_attributes', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_audio_attributes', init=False ) class TrackAudioAttributesChangelog(Base): __tablename__ = 'track_audio_attributes_changelog' __table_args__ = ( ForeignKeyConstraint( ['audio_attribute_id'], ['audio_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_taac_audio_attribute_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_taac_unique_track_id', ), Index('FK_taac_audio_attribute_id', 'audio_attribute_id'), Index('FK_taac_unique_track_id', 'unique_track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) audio_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) datetime: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) user_uuid: Mapped[Optional[str]] = mapped_column(CHAR(36), default=None) action: Mapped[Optional[str]] = mapped_column( Enum('insert', 'delete'), default=None ) change_source: Mapped[Optional[str]] = mapped_column(String(255), default=None) audio_attribute: Mapped['AudioAttributes'] = relationship( 'AudioAttributes', back_populates='track_audio_attributes_changelog', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_audio_attributes_changelog', init=False ) class TrackAudioAttributesEdits(Base): __tablename__ = 'track_audio_attributes_edits' __table_args__ = ( ForeignKeyConstraint( ['audio_attribute_id'], ['audio_attributes.id'], ondelete='CASCADE', name='FK_audio_attribute_edits_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='CASCADE', name='FK_unique_track_edits_id', ), Index('FK_audio_attribute_edits_id', 'audio_attribute_id'), Index( 'UC_Track_Attribute_Edits', 'unique_track_id', 'audio_attribute_id', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) audio_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) audio_attribute: Mapped['AudioAttributes'] = relationship( 'AudioAttributes', back_populates='track_audio_attributes_edits', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_audio_attributes_edits', init=False ) class TrackCredit(Base): __tablename__ = 'track_credit' __table_args__ = ( ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_credit' ), Index('track_id', 'track_id'), {'comment': 'Holds track credit information of tracks that are already in'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) role: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) url: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) artist_first_name: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) artist_last_name: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) crew_or_cast: Mapped[Optional[str]] = mapped_column( ENUM('crew', 'cast'), server_default=text("'crew'"), default=None ) billing: Mapped[Optional[str]] = mapped_column( ENUM('Ordered', 'Top'), server_default=text("'Ordered'"), default=None ) amg_id: Mapped[Optional[str]] = mapped_column( String(80, 'utf8mb4_general_ci'), default=None ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_credit', init=False ) class TrackCropInfo(Base): __tablename__ = 'track_crop_info' __table_args__ = ( ForeignKeyConstraint( ['orchard_user_id'], ['orchadmin_users.id'], ondelete='SET NULL', onupdate='RESTRICT', name='FK_track_crop_info_orchard_user_id', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', onupdate='RESTRICT', name='FK_track_crop_info_track_id', ), Index('FK_track_crop_info_orchard_user_id', 'orchard_user_id'), ) track_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) crop_left: Mapped[Optional[int]] = mapped_column(Integer, default=None) crop_right: Mapped[Optional[int]] = mapped_column(Integer, default=None) crop_top: Mapped[Optional[int]] = mapped_column(Integer, default=None) crop_bottom: Mapped[Optional[int]] = mapped_column(Integer, default=None) orchard_user_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) created_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) updated_timestamp: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) orchard_user: Mapped[Optional['OrchadminUsers']] = relationship( 'OrchadminUsers', back_populates='track_crop_info', init=False ) class TrackInstantGrat(Base): __tablename__ = 'track_instant_grat' __table_args__ = ( ForeignKeyConstraint( ['customer_master_master_id'], ['customer_master_master.customer_master_master_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_instant_grat_cmm', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_instant_grat', ), Index('FK_track_instant_grat', 'unique_track_id'), Index('FK_track_instant_grat_cmm', 'customer_master_master_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) date_created: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), ) customer_master_master_id: Mapped[Optional[int]] = mapped_column( SMALLINT, default=None ) unique_track_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) active: Mapped[Optional[str]] = mapped_column( ENUM('Y', 'N'), server_default=text("'Y'"), default=None ) date: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) added_by_user_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) added_by_user_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw'), server_default=text("'oa'"), default=None ) customer_master_master: Mapped[Optional['CustomerMasterMaster']] = relationship( 'CustomerMasterMaster', back_populates='track_instant_grat', init=False ) unique_track: Mapped[Optional['Track']] = relationship( 'Track', back_populates='track_instant_grat', init=False ) class TrackLocalizedMetadata(Base): __tablename__ = 'track_localized_metadata' __table_args__ = ( ForeignKeyConstraint( ['language_id'], ['itunes_languages.language_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_language_id_itunes_lan_tlm', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_id_track_tlm' ), Index('FK_language_id_itunes_lan_tlm', 'language_id'), Index('FK_track_id_track_tlm', 'track_id'), Index( 'IDX_track_id_language_id_unique', 'track_id', 'language_id', unique=True ), Index('IDX_track_name', 'track_name'), Index('IDX_version', 'version'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) language_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) track_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) version: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language: Mapped[Optional['ItunesLanguages']] = relationship( 'ItunesLanguages', back_populates='track_localized_metadata', init=False ) track: Mapped[Optional['Track']] = relationship( 'Track', back_populates='track_localized_metadata', init=False ) class TrackMasterRights(Base): __tablename__ = 'track_master_rights' __table_args__ = ( ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_id' ), Index('unique_track_id', 'track_id', unique=True), ) master_rights_id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) is_owner: Mapped[Optional[str]] = mapped_column(ENUM('y', 'n'), default=None) rights_level: Mapped[Optional[str]] = mapped_column( ENUM( 'original_owner', 'acquired_rights', 'exclusive_licensee', 'non_exclusive_licensee', 'no_rights', ), default=None, ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_master_rights', init=False ) class TrackPhysical(Base): __tablename__ = 'track_physical' __table_args__ = ( ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', onupdate='CASCADE', name='track_physical_ibfk_1', ), Index('FK_track_id', 'track_id'), {'comment': 'Metadata for physical tracks'}, ) track_physical_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) side: Mapped[Optional[str]] = mapped_column( String(64, 'utf8mb4_general_ci'), default=None ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_physical', init=False ) class TrackProducerNationality(Base): __tablename__ = 'track_producer_nationality' __table_args__ = ( ForeignKeyConstraint( ['nationality_country_id'], ['country.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_producer_nationality_country', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_producer_nationality_track', ), Index('FK_track_id', 'track_id', unique=True), Index('FK_track_producer_nationality_country', 'nationality_country_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary key', autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to the track table' ) nationality_country_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Foreign key to the country table' ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='Date of last update', default=None, ) nationality_country: Mapped['Country'] = relationship( 'Country', back_populates='track_producer_nationality', init=False ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_producer_nationality', init=False ) class TrackPublishing(Base): __tablename__ = 'track_publishing' __table_args__ = ( ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_uid' ), Index('track_uid', 'track_id', unique=True), ) id: Mapped[int] = mapped_column( Integer, primary_key=True, comment='Primary key', autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column( INTEGER, nullable=False, comment='Foreign key to track table' ) us_publishing: Mapped[Optional[str]] = mapped_column( ENUM( 'controlled_by_label', 'composition_administered', 'public_domain', 'not_distributed', ), comment="US Publishing options of track. Value can be 'controlled_by_label','composition_administered','public_domain','not_distributed'.", default=None, ) iswc: Mapped[Optional[str]] = mapped_column( String(16, 'utf8mb4_general_ci'), comment='ISWC code of the track.', default=None, ) track: Mapped['Track'] = relationship( 'Track', back_populates='track_publishing', init=False ) class TrackRightsAttributeSuggestions(Base): __tablename__ = 'track_rights_attribute_suggestions' __table_args__ = ( ForeignKeyConstraint( ['unique_track_id'], ['track.id'], name='FK_track_rights_attribute_suggestions_track', ), Index('FK_track_rights_attribute_suggestions_track', 'unique_track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) user_uuid: Mapped[str] = mapped_column(CHAR(36), nullable=False) suggested_at: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) review_queue_id: Mapped[int] = mapped_column(INTEGER, nullable=False) suggestions: Mapped[dict] = mapped_column(JSON, nullable=False) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_rights_attribute_suggestions', init=False ) class TrackRightsAttributes(Base): __tablename__ = 'track_rights_attributes' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_rights_rights_attribute_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_rights_track_unique_id', ), Index('FK_track_rights_rights_attribute_id', 'rights_attribute_id'), Index( 'UC_Track_Attribute', 'unique_track_id', 'rights_attribute_id', unique=True ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='track_rights_attributes', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_rights_attributes', init=False ) class TrackRightsAttributesChangelog(Base): __tablename__ = 'track_rights_attributes_changelog' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_trac_rights_attribute_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_trac_unique_track_id', ), Index('FK_trac_rights_attribute_id', 'rights_attribute_id'), Index('FK_trac_unique_track_id', 'unique_track_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) datetime: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP') ) user_uuid: Mapped[Optional[str]] = mapped_column(CHAR(36), default=None) action: Mapped[Optional[str]] = mapped_column( Enum('insert', 'delete'), default=None ) change_source: Mapped[Optional[str]] = mapped_column(String(255), default=None) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='track_rights_attributes_changelog', init=False, ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_rights_attributes_changelog', init=False ) class TrackRightsAttributesEdits(Base): __tablename__ = 'track_rights_attributes_edits' __table_args__ = ( ForeignKeyConstraint( ['rights_attribute_id'], ['rights_attributes.id'], ondelete='CASCADE', name='FK_rights_attribute_edits_id', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='CASCADE', name='FK_unique_track_rights_edits_id', ), Index('FK_rights_attribute_edits_id', 'rights_attribute_id'), Index( 'UC_Track_Rights_Attribute_Edits', 'unique_track_id', 'rights_attribute_id', unique=True, ), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) rights_attribute_id: Mapped[int] = mapped_column(TINYINT, nullable=False) rights_attribute: Mapped['RightsAttributes'] = relationship( 'RightsAttributes', back_populates='track_rights_attributes_edits', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_rights_attributes_edits', init=False ) class TrackSpatial(Base, CreateMixin): __tablename__ = 'track_spatial' __table_args__ = ( ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='CASCADE', name='FK_track_spatial_track_id', ), Index('IDX_track_spatial_isrc', 'isrc'), ) track_id: Mapped[int] = mapped_column(INTEGER, primary_key=True) isrc: Mapped[str] = mapped_column(String(16), nullable=False) updated_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), default=None, ) created_at: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP'), default=None ) class TrackTag(Base): __tablename__ = 'track_tag' __table_args__ = ( ForeignKeyConstraint( ['tag_id'], ['tag.tag_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_tag_tag', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_tag', ), Index('tag_id', 'tag_id'), Index('track_id', 'track_id', 'tag_id', unique=True), {'comment': 'Links track & tags table providing tags associated with each'}, ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) tag_id: Mapped[int] = mapped_column(SMALLINT, nullable=False) tag: Mapped['Tag'] = relationship('Tag', back_populates='track_tag', init=False) track: Mapped['Track'] = relationship( 'Track', back_populates='track_tag', init=False ) class TrackWriter(Base): __tablename__ = 'track_writer' __table_args__ = ( ForeignKeyConstraint( ['artist_info_id'], ['artist_info.artist_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='fk_track_writer_to_artist_info', ), ForeignKeyConstraint( ['unique_track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_writer_unique_track_id', ), ForeignKeyConstraint( ['upc'], ['releases.upc'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_track_writer', ), Index('fk_track_writer_to_artist_info', 'artist_info_id'), Index('fk_track_writer_to_releases', 'upc'), Index('unique_track_id', 'unique_track_id'), {'comment': 'Holds track writer information of tracks that are already in'}, ) track_writer_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Autoincement Primary key.', autoincrement=True, init=False, ) writer_name: Mapped[str] = mapped_column( String(255, 'utf8mb4_general_ci'), nullable=False, comment='Name of the songwriter.', ) upc: Mapped[int] = mapped_column( BIGINT, nullable=False, comment='UPC of the release. Serves as foreign key to releases table.', ) cd: Mapped[int] = mapped_column( TINYINT, nullable=False, comment='Volume # of the track.' ) track_id: Mapped[int] = mapped_column( SMALLINT, nullable=False, comment='Track number of the track.' ) unique_track_id: Mapped[int] = mapped_column(INTEGER, nullable=False) artist_info_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) label_participant_id: Mapped[Optional[int]] = mapped_column(Integer, default=None) artist_info: Mapped[Optional['ArtistInfo']] = relationship( 'ArtistInfo', back_populates='track_writer', init=False ) unique_track: Mapped['Track'] = relationship( 'Track', back_populates='track_writer', init=False ) releases: Mapped['Releases'] = relationship( 'Releases', back_populates='track_writer', init=False ) class YoutubeChannelVideoStatus(Base): __tablename__ = 'youtube_channel_video_status' __table_args__ = ( ForeignKeyConstraint( ['release_id'], ['releases.release_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_status_release_id', ), ForeignKeyConstraint( ['track_id'], ['track.id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_status_track_id', ), ForeignKeyConstraint( ['youtube_channel_id'], ['youtube_channel.youtube_channel_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_status_channel_id', ), Index('FK_youtube_video_status_channel_id', 'youtube_channel_id'), Index('FK_youtube_video_status_release_id', 'release_id'), Index('Unique_youtube_video_id', 'youtube_video_id', unique=True), Index('unq_asset_id', 'youtube_asset_id', unique=True), Index('unq_claim_id', 'youtube_claim_id', unique=True), Index('unq_reference_id', 'youtube_reference_id', unique=True), Index('unq_track_id', 'track_id', unique=True), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, comment='Primary Key', autoincrement=True, init=False ) youtube_video_id: Mapped[str] = mapped_column( String(20, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment='Unique youtube video id', ) youtube_channel_id: Mapped[str] = mapped_column( String(50, 'utf8mb4_general_ci'), nullable=False, comment='Fkey to youtube_channel table for youtubes channel id', ) in_processing: Mapped[str] = mapped_column( ENUM('Y', 'N'), nullable=False, server_default=text("'Y'"), comment='video is being processed in a Q and doesnt need added again to first queue', ) video_search_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time that we inserted the youtube_video_id to table', default=None, ) release_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='FKey to releases table', default=None ) track_id: Mapped[Optional[int]] = mapped_column( INTEGER, comment='Fkey to track table', default=None ) track_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed creating track through vapi', default=None, ) youtube_asset_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='unique youtube asset id', default=None, ) asset_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube insert asset api call', default=None, ) ownership_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube ownership api call', default=None, ) youtube_claim_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='Unique youtube claim id', default=None, ) claim_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube claim api call', default=None, ) asset_match_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube asset match api call', default=None, ) youtube_reference_id: Mapped[Optional[str]] = mapped_column( String(20, 'utf8mb4_general_ci'), comment='unique youtube reference id', default=None, ) reference_insert_time: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, comment='time we successfully completed youtube reference api call', default=None, ) last_updated: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='when this row was last updated', default=None, ) error_type: Mapped[Optional[str]] = mapped_column( ENUM( 'already_claimed_error', 'short_for_reference_error', 'vapi_error', 'video_processing_error', 'reference_exist_error', 'other_error', 'reached_max_attempts', 'video_not_owned', ), default=None, ) release: Mapped[Optional['Releases']] = relationship( 'Releases', back_populates='youtube_channel_video_status', init=False ) track: Mapped[Optional['Track']] = relationship( 'Track', back_populates='youtube_channel_video_status', init=False ) youtube_channel: Mapped['YoutubeChannel'] = relationship( 'YoutubeChannel', back_populates='youtube_channel_video_status', init=False ) class RejectionNotes(Base): __tablename__ = 'rejection_notes' __table_args__ = ( ForeignKeyConstraint( ['release_approval_id'], ['release_approval_queue.release_approval_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_rejection_notes_release_approval', ), Index('FK_rejection_notes_release_approval', 'release_approval_id'), ) rejection_id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_approval_id: Mapped[int] = mapped_column(INTEGER, nullable=False) table_name: Mapped[str] = mapped_column( String(45, 'utf8mb4_general_ci'), nullable=False ) comments: Mapped[str] = mapped_column( Text(collation='utf8mb4_general_ci'), nullable=False ) corrected: Mapped[str] = mapped_column(ENUM('Y', 'N'), nullable=False) date_added: Mapped[datetime.datetime] = mapped_column( NormalizedDateTime, nullable=False ) field_name: Mapped[Optional[str]] = mapped_column( String(45, 'utf8mb4_general_ci'), default=None ) key_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) changed_by: Mapped[Optional[int]] = mapped_column( Integer, comment='user_id who modified the rejections_notes record.', default=None, ) changed_by_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user oa or alw or system', default=None, ) release_approval: Mapped['ReleaseApprovalQueue'] = relationship( 'ReleaseApprovalQueue', back_populates='rejection_notes', init=False ) class ReleaseApprovalComments(Base): __tablename__ = 'release_approval_comments' __table_args__ = ( ForeignKeyConstraint( ['release_approval_id'], ['release_approval_queue.release_approval_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_approval_comments_approval_id', ), ForeignKeyConstraint( ['release_status_id'], ['release_status.release_status_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_release_approval_comments', ), Index('FK_approval_comments_approval_id', 'release_approval_id'), Index('FK_release_approval_comments', 'release_status_id'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) release_status_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) release_approval_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) comment: Mapped[Optional[str]] = mapped_column( Text(collation='utf8mb4_general_ci'), default=None ) datetime: Mapped[Optional[datetime.datetime]] = mapped_column( NormalizedDateTime, default=None ) changed_by: Mapped[Optional[int]] = mapped_column( Integer, comment='user_id who modified the release_approval_comments record.', default=None, ) changed_by_type: Mapped[Optional[str]] = mapped_column( ENUM('oa', 'alw', 'system'), comment='Type of user oa or alw or system', default=None, ) release_approval: Mapped[Optional['ReleaseApprovalQueue']] = relationship( 'ReleaseApprovalQueue', back_populates='release_approval_comments', init=False ) release_status: Mapped[Optional['ReleaseStatus']] = relationship( 'ReleaseStatus', back_populates='release_approval_comments', init=False ) class TrackArtistLocalizedMetadata(Base): __tablename__ = 'track_artist_localized_metadata' __table_args__ = ( ForeignKeyConstraint( ['language_id'], ['itunes_languages.language_id'], ondelete='RESTRICT', onupdate='RESTRICT', name='FK_language_id_itunes_lan_tal', ), ForeignKeyConstraint( ['track_artist_id'], ['track_artist.id'], ondelete='CASCADE', name='FK_track_artist_id_track_tal', ), Index('FK_language_id_itunes_lan_tal', 'language_id'), Index('FK_track_artist_id_track_tal', 'track_artist_id'), Index('IDX_artist_name', 'artist_name'), ) id: Mapped[int] = mapped_column( INTEGER, primary_key=True, autoincrement=True, init=False ) track_artist_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) language_id: Mapped[Optional[int]] = mapped_column(INTEGER, default=None) artist_name: Mapped[Optional[str]] = mapped_column( String(255, 'utf8mb4_general_ci'), default=None ) language: Mapped[Optional['ItunesLanguages']] = relationship( 'ItunesLanguages', back_populates='track_artist_localized_metadata', init=False ) track_artist: Mapped[Optional['TrackArtist']] = relationship( 'TrackArtist', back_populates='track_artist_localized_metadata', init=False )