# ___________________░▒▓▓▓▓▒░
# ________________░▒▒▓▒▒▒▒▒▒▓▓▒░
# ______________▒▓▓▒▒▒▒▓▓▒▒▒▒▒▓▓▓
# _____________▓▓▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▓▓░__________________░▒▒▓▓▓▓▓▓▓▒
# ____________▒▓▒▒▓▓▓░░░░░░░░▒▓▒▒▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒░__▒▓▓▓▒▒▒▒▓▓▓▓▓▓▒
# ____________▓▓▒▒▓▓░░░░░░▒▓▓▓▓▓▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▓▓▓▓▓▓▓▒▒▒▓▓▓▓▒▒▒▒▒▓▓
# ____________▓▓▒▒▓▓░░░▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓░░░░░░░░▒▓▒
# ____________▒▓▒▒▒▓▓▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒░░░░░░░▓▒
# _____________▓▓▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓░░░░░▒▓
# ______________▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒░░▒▓░
# ______________░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▓
# _____________░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒
# ____________░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒
# ____________▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
# ___________▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▒▒▒▒▓▒
# ___________▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▓
# __________▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒▒▓
# __________▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▒▒▒▒▒▓░
# _________░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░▒▒▒░▒▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▓░
# _________▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒░░░░░░░▒▓▓▓▓▓▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
# ________▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒░░░░░░░░▒▓▓▓▓▓▓▓▒░░░░░▒▓▒▒▒▒▒▒▒▒▒▒▓▒
# _______▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓░░░░░░░░░░▓▓▓▓▓▓▒░░░░░░░▓▓▒▒▒▒▒▒▒▒▒▓▓
# _____░▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒░░░░░░░░░▒▓▓▒░░░░░░░░▒▓▓▒▒▒▒▒▒▒▒▒▒▓░
# ____░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓▒▒░░░▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓
# ___▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▓▓░░░░░░░░▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓
# ___░░░▒▓▓▒▒▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▓▓░░░░░░░░▒▒▓▓▒▒▒▒▒▒▒▒▒▓▒▒▒▒▓▓▓▓▓▓
# ______▓▓▓▓▓▓▓▒▓▓▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒▓▓░░░░░░░▒▒▓▓▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▓▓
# _____░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒▒▓▓▒░░░░▒▒▒▓▓▒▒▒▒▒▓▓▒▒▓▓▓▓▒▓▓░
# ______░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▓▓▓▓▓▒▒▓▓▒▒▒▒▒▒▓▓▓▓▓▒▓▓▓▓▓▓░
# ______▒▓▓▓▓▓▒▒▓▓▓▓▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▓▓░
# ____░▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
#
#
#           JUST WAITIN' AND PROTECTIN' UR VULNERABLE MODEL
#

propel:
  expedition:
    _attributes:            { phpName: Expedition }
    id:                     { type: integer, primaryKey: true, autoIncrement: true }
    # common stuff goes here
    title:                  { type: varchar(256) }
    updated_at:             ~
    duration:               { type: varchar(256) }
    region:                 { type: varchar(256) }
    continent_id:           { type: integer, foreignTable: continent, foreignReference: id, required: false }
    is_active:              { type: boolean, default: 0 }
    is_on_main:             { type: boolean, default: 0 }
    ord:                    { type: integer, default: 1 }
    # description
    col_left_group_id:      { type: integer, foreignTable: static_text_group, foreignReference: id, required: false }
    col_right_group_id:     { type: integer, foreignTable: static_text_group, foreignReference: id, required: false }
    # photo
    photo_list_normal:      { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    photo_list_sepia:       { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    photo_top:              { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    # map
    bg_lat:                 { type: varchar(16) }
    bg_lng:                 { type: varchar(16) }
    bg_zoom:                { type: varchar(16) }
    # payment misc
    payment_misc:           { type: varchar(4096) }
    # is_temp
    is_temp:                { type: boolean, default: true }
    # map
    map_image:              { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    map_big_image:          { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    map_code:               { type: varchar(4096) }
    gallery_id:     { type: integer, foreignTable: gallery, foreignReference: id, required: false, onDelete: setnull }
    thumb_info: 	{ type: varchar(255) }
    # OpenGraph
    og_title:               { type: varchar(256) }
    og_description:         { type: varchar(512) }
    og_image:               { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }

  expedition_type:
    id:                     ~
    _attributes:            { phpName: ExpeditionType }
    title:                  { type: varchar(256) }
    short:                  { type: varchar(16) }

  expedition_details:
    id:                     ~
    # unique number
    number:                 { type: varchar(256), unique: true }
    # date
    date_beginning:         { type: date }
    date_finish:            { type: date }
    date_descr:             { type: varchar(4096) }
    # price
    price:                  { type: double }
    price_cur_id:           { type: integer, foreignTable: currency, foreignReference: id, required: false }
    #pr#ice_descr:            { type: varchar(4096) }
    # flight price
    flight_price_range:     { type: varchar(4096) }
    flight_price_cur_id:    { type: integer, foreignTable: currency, foreignReference: id, required: false }
    # exp
    expedition_id:          { type: integer, foreignTable: expedition, foreignReference: id, required: false, onDelete: cascade }

  expedition_expedition_type:
    _attributes:            { phpName: ExpeditionExpeditionType }
    expedition_id:          { primaryKey: true, type: integer, foreignTable: expedition, foreignReference: id, onDelete: cascade, required: true }
    expedition_type_id:     { primaryKey: true, type: integer, foreignTable: expedition_type, foreignReference: id, onDelete: cascade, required: true }
  
  expedition_reports:
    id:                     ~
    content:                { type: varchar(4096) }
    report_group_id:        { type: integer, foreignTable: static_text_group, foreignReference: id, required: true, onDelete: cascade }
    gallery_id:             { type: integer, foreignTable: gallery, foreignReference: id, required: false, onDelete: setnull }
    expedition_id:          { type: integer, foreignTable: expedition, foreignReference: id, required: true, onDelete: cascade }
    show_button:            { type: boolean, default: 0 }
    photo_top:              { type: integer, foreignTable: file, foreignReference: id, required: false, onDelete: setnull }
    sort_order:             { type: integer }
  
  static_text:
    _attributes:            { phpName: StaticText }
    id:                     ~
    title:                  { type: varchar(256) }
    content:                { type: varchar(16384) }
    is_standalone:          { type: boolean, default: 0 }
    stripped_title:         { type: varchar(256) }
    ord:                    { type: integer }
    static_text_group_id:   { type: integer, foreignTable: static_text_group, foreignReference: id, required: false }
    author:                 { type: varchar(256) }

  static_text_group:
    id:                     ~
    title:                  { type: varchar(256) }
    is_standalone:          { type: boolean, default: 0 }

  feed:
    _attributes:            { phpName: Feed }
    id:                     ~
    link:                   { type: varchar(256) }
    content:                { type: varchar(16384) }
    date:                   { type: timestamp }
    obtained:               { type: timestamp }
    feed_type_id:           { type: integer, foreignTable: feed_type, foreignReference: id, required: true }
    media_link:             { type: varchar(512) }
    visible:                { type: boolean, default: true }

  file:
    _attributes:            { phpName: File }
    id:                     ~
    name:                   { type: varchar(256) }
    assoc_files:            { type: varchar(1024) }
    caption:                { type: varchar(256) }
    comment:                { type: varchar(256) }
    mime:                   { type: varchar(256) }
    imxs:                   { type: integer }
    imys:                   { type: integer }

  gallery:
    _attributes:            { phpName: Gallery }
    id:                     ~
    created_at:             ~
    title:                  { type: varchar(256) }
    ord:                    { type: varchar(1024) }

  gallery_file:
    _attributes:            { phpName: GalleryFile }
    gallery_id:             { primaryKey: true, type: integer, foreignTable: gallery, foreignReference: id, onDelete: cascade, required: true }
    file_id:                { primaryKey: true, type: integer, foreignTable: file, foreignReference: id, onDelete: cascade, required: true }

# dictionaries
  continent:
    _attributes:            { phpName: Continent }
    id:                     ~
    title:                  { type: varchar(256) }
    bg_lat:                 { type: varchar(16) }
    bg_lng:                 { type: varchar(16) }
    bg_zoom:                { type: varchar(16) }

  currency:
    _attributes:            { phpName: Currency }
    id:                     ~
    title:                  { type: varchar(32) }
    exchange:               { type: float }

  feed_type:
    _attributes:            { phpName: FeedType }
    id:                     ~
    short:                  { type: varchar(8) }

#misc
  newsletter_subscriptions:
    _attributes:        { phpName: NewsletterSubscription }
    id:                 serial
    # adres do wysyłki newslettera
    email:              { type: varchar, size: 128, reuired: true, index: unique }
    # hash identyfikacyjny służący do potwierdzenia, generowany tylko raz
    confirmation_hash:  { type: varchar, size: 128, required: true }
    # hash identyfikacyjny do wypisania z newslettera, generowany tylko raz
    unsubscribe_hash:   { type: varchar, size: 40, required: true }
    # potwierdzony? (tylko potwierdzone są na liście userów do pobrania)
    is_confirmed:       { type: boolean, default: false }

  contact:
    _attributes:            { phpName: Contact }
    id:                     ~
    subject:                { type: varchar(100) }
    date:                   { type: varchar(100) }
    name:                   { type: varchar(100) }
    email:                  { type: varchar(100) }
    phone:                  { type: varchar(50) }
    message:                { type: varchar(4000) }
    created_at:             ~

  setting:
    _attributes:            { phpName: Setting }
    name:                   { type: varchar(32), required: true, index: unique, primaryKey: true }
    value:                  { type: varchar(256) }
