i use in my schema the 2 letters country code as my foreign key.
so first primary key was id and i got the value in the options the IDs
or PromoteCountry, then I thought I would use the country column as
the primary key to test this option, but the admin didn't display
anything as i know it doesn't display primary key. so not sure how to
use the foreign keys between tables instead of numeric values, string.

schema.yml
PromoteCountry:
  columns:
    country:
      type: string(2)
      notnull: true
#      primary: true
  options:
    collate: utf8_unicode_ci
    charset: utf8
  relations:
    BookingComHotels: { local: country, foreign: country, onDelete:
cascade, foreignAlias: PromoteCountrys }

BookingComHotels:
  columns:
    id_hash:
      type: BINARY(16)
      notnull: true
      unique: true
    town:
      type: string(100)
      notnull: true
    quantity:
      type: integer(4)
    country:
      type: string(2)
      notnull: true
    promote:
      type: boolean
  options:
    collate: utf8_unicode_ci
    charset: utf8

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to