IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ORM PHP Discussion :

[Doctrine] erreur lors du build--sql


Sujet :

ORM PHP

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    19
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 19
    Points : 12
    Points
    12
    Par défaut [Doctrine] erreur lors du build--sql
    Bonjour à tous !

    Suite aux conseils d'un ami qui suit la même formation que moi, je me suis lancé dans l'apprantissage de symfony (je n'avais jamais utilisé de framework avant)

    J'ai un petit soucis avec mon shéma yml.

    J'arrive à faire un Doctrine:build --model sans avoir d'erreur, mais quand je fais doctrine:build --sql j'ai cette erreur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ./symfony doctrine:build --sql
    >> doctrine  generating model classes
    >> file+     /tmp/doctrine_schema_40147.yml
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseCashGame.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseRepartition.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseCashGameResultats.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseSng.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseResultats.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseMtt.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseMttResultats.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseManches.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseSngResultats.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseChampionnats.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseJoueurs.class.php
    >> tokens    /home/vincent/www/Poker05/lib/model/doctrine/base/BaseAlias.class.php
    >> autoload  Resetting application autoloaders
    >> file-     /home/vincent/www/Poker05/cache/frontend/dev/config/config_autoload.yml.php
    >> doctrine  generating sql for models
    PHP Parse error:  syntax error, unexpected '.', expecting T_STRING in /home/vincent/www/Poker05/lib/model/doctrine/. { typeTable.class.php on line 8
     
    Parse error: syntax error, unexpected '.', expecting T_STRING in /home/vincent/www/Poker05/lib/model/doctrine/. { typeTable.class.php on line 8

    J'ai beau chercher, je ne trouve pas d'où ça peut venir dans mon shéma, et j'ai cherché sur internet une solution à ce problème sans en avoir trouvé.

    voilà mon shéma:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    Alias:
      connection: doctrine
      tableName: alias
      columns:
        id:
          type: integer(8)
          autoincrement: true
          primary: true
        pseudo:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        created_at:
          type: timestamp(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        updated_at:
          type: timestamp(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
      relations:
        Joueurs: 
          class: Joueurs
          local: joueur_id
          foreign: joueur_id
          foreignAlias: Alias
     
    Championnats:
      connection: doctrine
      tableName: championnats
      columns:
        champ_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        champ_lib:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        date_debut:
          type: date(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        date_fin:
          type: date(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        nb_rounds:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          default: '1'
          notnull: true
          autoincrement: false
        tournoi_final:
          type: integer(1)
          fixed: false
          unsigned: false
          primary: false
          default: '1'
          notnull: true
          autoincrement: false
     
    Joueurs:
      connection: doctrine
      tableName: joueurs
      columns:
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        nom:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        prenom:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        pseudo_usuel:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        email:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        naissance:
          type: date(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        adresse1:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        adresse2:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        ville:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        cp:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        tel_fixe:
          type: string(30)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        tel_portable:
          type: string(30)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false    
     
    Manches:
      connection: doctrine
      tableName: manches
      columns:
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        champ_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        date_manche:
          type: date(25)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        nom_manche:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
      relations:
        Championnats: 
          class: Championnats
          local: champ_id
          foreign: champ_id
          foreignAlias: Championnats
     
    CashGame:
      connection: doctrine
      tableName: cashgame
      columns:
        cash_game_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        cave:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        max_recaves:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: manche_id
          foreign: manche_id
          foreignAlias: CashGames
     
    CashGameResultats:
      connection: doctrine
      tableName: cashgame_resultats
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        cash_game_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        caves:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        cave_finale:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: cash_game_id
          foreign: cash_game_id
          foreignAlias: Resultats
     
    Mtt:
      connection: doctrine
      tableName: mtt
      columns:
        mtt_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        buy_in:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        repartition_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: manche_id
          foreign: manche_id
          foreignAlias: Mtts 
        Repartition:
          class: Repartition
          local: repartition_id
          foreign: repartition_id
          foreignAlias: Repartition
     
    MttResultats:
      connection: doctrine
      tableName: mtt_resultats
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        mtt_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        place:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
      relations:
        Mtt: 
          class: Mtt
          local: mtt_id
          foreign: mtt_id
          foreignAlias: Resultats
     
    Resultats:
      connection: doctrine
      tableName: resultats
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        pseudo:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        points:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          default: '0'
          notnull: false
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: manche_id
          foreign: manche_id
          foreignAlias: Resultats
     
    Sng:
      connection: doctrine
      tableName: sng
      columns:
        sng_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        buy_in:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        repartition_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: manche_id
          foreign: manche_id
          foreignAlias: Sngs
        Repartition:
          class: Repartition
          local: repartition_id
          foreign: repartition_id
          foreignAlias: Repartition
     
    SngResultats:
      connection: doctrine
      tableName: sng_resultats
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        sng_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        joueur_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        place:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
      relations:
        Sng: 
          class: Sng
          local: sng_id
          foreign: sng_id
          foreignAlias: Resultats
     
    Repartition:
      connection: doctrine
      tableName: repartition
      columns:
        repartition_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        repartition_schema:
          type: string(100)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        repartition_label:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
     
    Resultats:
      connection: doctrine
      tableName: resultat
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        pseudo:
          type: string(50)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        points:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          default: '0'
          notnull: false
          autoincrement: false
      relations:
        Manches: 
          class: Manches
          local: manche_id
          foreign: manche_id
          foreignAlias: OldTableResultats
    Si quelqu'un a une idée ça serait sympa

  2. #2
    Expert éminent
    Avatar de Michel Rotta
    Homme Profil pro
    DPO
    Inscrit en
    Septembre 2005
    Messages
    4 954
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : DPO
    Secteur : Distribution

    Informations forums :
    Inscription : Septembre 2005
    Messages : 4 954
    Points : 8 486
    Points
    8 486
    Par défaut
    Pour des petits shema, je veux bien faire une lecture détaillées, et les corrections, le tiens dépasse de beaucoup le terme petit.

    Je l'ai parcouru en diagonal et je te propose d'y apporter les modifications suivantes et de le remettre en ligne, je le relirais, allégé, à ce moment là.
    • Le nom des tables doit toujours être au singulier et en minuscule. Si un nom de table termine au singulier par un "s", il convient de tout mettre en œuvre pour le changer.
    • Il ne sert à rien de déclarer le champ id, s'il n'y a pas de clef primaire définie, Doctrine le crée automatiquement.
    • La clef d'une table s'appelle toujours id (cf champ_id) pour Doctrine, champ_id est la clef de liaison pour la table champ dans une autre table, ce qui, ici, ne correspond à rien.
    • Il faut nettoyer le schéma de toutes les données par défauts : unsigned: false, primary: false.... Toutes les valeurs sont à false par défaut, inutile de le préciser.
    • date(25) ?
    • Les relations doivent n'être écrite que d'un côté de la relation, du côté n de la relation, si les id et les nom des champs de liaisons sont conformes à la norme, la relation peut ne prendre qu'une donnée, foreignAlias, les autres sont définies par défaut.
    • connection n'est en principe pas nécessaire, sauf si tu utilises plusieurs connection.
    • tableName n'est nécessaire que si tu veux un nom précis de table, si le nom du modèle convient, à la trape tableName.
    • Dans la mesure du possible, le nom de la table doit être compréhensible (cf Mtt)


    Une fois cette cure de simplification, le schéma devrait être passé de 560 à 150 lignes, on va pouvoir un peu creuser.

    Dernière chose, si tu veux correctement fonctionner sur symfony il faut que le shema.yml soit écrit et génère la base, pas partir d'une base existante pour générer un shema.yml. Ceci est à réserver à des cas très particulier et désespérés.
    Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).

    • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
    • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
    • Une discussion est terminée ? Alors le bouton est votre ami !

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    19
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 19
    Points : 12
    Points
    12
    Par défaut
    Re !

    Merci pour ces conseils. J'avais effectivement généré au départ le fichier en fonction de la base et je voulais juste ajouter les contraintes apres. Apparemment c'était pas une bonne idée ^^

    J'ai apporté les modifications demandées et voilà le fichier:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    alias:
      columns:
        pseudo:
          type: string(50)
          notnull: true
        joueur_id:
          type: integer(8)
          notnull: true
      relations:
        joueur: 
          local: joueur_id
          foreign: id
          foreignAlias: Alias
     
    championnat:
      columns:
        champ_lib:
          type: string(50)
          notnull: true
        date_debut:
          type: date
          notnull: true
        date_fin:
          type: date
          notnull: true
        nb_rounds:
          type: integer(8)
          default: '1'
          notnull: true
        tournoi_final:
          type: integer(1)
          fixed: false
          default: '0'
          notnull: true
     
    joueur:
      columns:
        nom:
          type: string(50)
          notnull: true
        prenom:
          type: string(50)
          notnull: true
        pseudo_usuel:
          type: string(50)
          notnull: true
        email:
          type: string(50)
        naissance:
          type: date
          notnull: true
        adresse1:
          type: string(255)
        adresse2:
          type: string(255)
        ville:
          type: string(50)
        cp:
          type: integer(8)
        tel_fixe:
          type: string(30)
        tel_portable:
          type: string(30)   
     
    manche:
      columns:
        champ_id:
          type: integer(8)
          notnull: true
        date_manche:
          type: date
          notnull: true
        nom_manche:
          type: string(50)
          notnull: true
      relations:
        championnat: 
          local: champ_id
          foreign: id
          foreignAlias: Championnats
     
    cashgame:
      columns:
        manche_id:
          type: integer(8)
        cave:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        max_recaves:
          type: integer(8)
          notnull: true
      relations:
        manche: 
          local: manche_id
          foreign: id
          foreignAlias: CashGames
     
    cashgameresultat:
      columns:
        cash_game_id:
          type: integer(8)
        joueur_id:
          type: integer(8)
        caves:
          type: integer(8)
          notnull: true
        cave_finale:
          type: integer(8)
          notnull: true
      relations:
        manche: 
          local: cash_game_id
          foreign: id
          foreignAlias: Resultats
     
    mtt:
      columns:
        manche_id:
          type: integer(8)
        buy_in:
          type: integer(8)
        repartition_id:
          type: integer(8)
      relations:
        manche: 
          local: manche_id
          foreign: id
          foreignAlias: Mtts 
        repartition:
          local: repartition_id
          foreign: id
          foreignAlias: Repartition
     
    mttresultat:
      columns:
        mtt_id:
          type: integer(8)
        joueur_id:
          type: integer(8)
        place:
          type: integer(8)
      relations:
        mtt: 
          local: mtt_id
          foreign: id
          foreignAlias: Resultats
     
    resultat:
      columns:
        manche_id:
          type: integer(8)
        joueur_id:
          type: integer(8)
        pseudo:
          type: string(50)
        points:
          type: integer(8)
          default: '0'
      relations:
        manche: 
          local: manche_id
          foreign: id
          foreignAlias: Resultats
     
    sng:
      columns:
        sng_id:
          type: integer(8)
          primary: true
          autoincrement: true
        manche_id:
          type: integer(8)
        buy_in:
          type: integer(8)
        repartition_id:
          type: integer(8)
      relations:
        manche: 
          local: manche_id
          foreign: id
          foreignAlias: Sngs
        repartition:
          local: repartition_id
          foreign: id
          foreignAlias: Repartition
     
    sngresultat:
      columns:
        sng_id:
          type: integer(8)
        joueur_id:
          type: integer(8)
        place:
          type: integer(8)
      relations:
        sng: 
          local: sng_id
          foreign: id
          foreignAlias: Resultats
     
    repartition:
      columns:
        repartition_id:
          type: integer(8)
          primary: true
          autoincrement: true
        repartition_schema:
          type: string(100)
          notnull: true
        repartition_label:
          type: string(50)
          notnull: true
    230 lignes encore mais bon, je ne pense pas qu'il y ait du superflu.

    j'ai juste laissé la table alias avec un s

    les noms mtt ou sng sont très parlants pour moi (c'est pour un site sur le poker)

    si vous trouvez l'erreur c'est cool, mais si vous me dites juste où je dois chercher (quel type d'erreur ça peut être) je peux chercher moi, c'est juste que je ne sais même pas quoi chercher en fait...

    en tout cas merci

    et l'erreur est toujours la même:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    >> doctrine  generating sql for models
    PHP Parse error:  syntax error, unexpected '.', expecting T_STRING in /home/vincent/www/Poker05/lib/model/doctrine/. { typeTable.class.php on line 8
     
    Parse error: syntax error, unexpected '.', expecting T_STRING in /home/vincent/www/Poker05/lib/model/doctrine/. { typeTable.class.php on line 8

  4. #4
    Expert éminent
    Avatar de Michel Rotta
    Homme Profil pro
    DPO
    Inscrit en
    Septembre 2005
    Messages
    4 954
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : DPO
    Secteur : Distribution

    Informations forums :
    Inscription : Septembre 2005
    Messages : 4 954
    Points : 8 486
    Points
    8 486
    Par défaut
    J'ai un peu corrigé et allégé le fichier (ben oui, c'est possible !)

    • le code postal n'est pas une donnée numérique, il est possible dans certain cas d'y trouver des caractères. En règle général, on ne met en donnée numérique que les données sur lesquels on veut faire des calculs, et une moyenne des codes postaux, c'est pas top.
    • pour les relations, le foreignAlias est le nom de la relation vue de l'autre côté de la relation, donc, par exemple, pour la relation définie sur manche vers championnat n manches pour 1 championnat, le foreignAlias est "manches" au pluriel, vu que, du côté du championnat, on récupère les "manches" (->getManches() ) ce qui retourne une collection des manches du championnat
    • Table manche, champ_id devient évidement championnat_id.
    • Pourquoi sng_id en primary ? Je classe en oubli. D'autant que les autres tables font référence à un id dans sng qui n'existe pas.
    • Idem pour répartition


    On arrive au shema.yml suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
     
    alias:
      columns:
        pseudo:
          type: string(50)
          notnull: true
        joueur_id:
          type: integer
          notnull: true
      relations:
        joueur:
          local: joueur_id
          foreign: id
          foreignAlias: Aliass
     
    championnat:
      columns:
        champ_lib:
          type: string(50)
          notnull: true
        date_debut:
          type: date
          notnull: true
        date_fin:
          type: date
          notnull: true
        nb_rounds:
          type: integer
          default: '1'
          notnull: true
        tournoi_final:
          type: integer(1)
          fixed: false
          default: '0'
          notnull: true
     
    joueur:
      columns:
        nom:
          type: string(50)
          notnull: true
        prenom:
          type: string(50)
          notnull: true
        pseudo_usuel:
          type: string(50)
          notnull: true
        email: string(50)
        naissance:
          type: date
          notnull: true
        adresse1: string(255)
        adresse2: string(255)
        ville: string(50)
        cp: string(10)
        tel_fixe: string(30)
        tel_portable: string(30)
     
    manche:
      columns:
        championnat_id:
          type: integer
          notnull: true
        date_manche:
          type: date
          notnull: true
        nom_manche:
          type: string(50)
          notnull: true
      relations:
        championnat:
          foreignAlias: manches
     
    cashgame:
      columns:
        manche_id: integer
        cave: integer
        max_recaves:
          type: integer
          notnull: true
      relations:
        manche:
          foreignAlias: CashGames
     
    cashgameresultat:
      columns:
        cash_game_id: integer
        joueur_id: integer
        caves:
          type: integer
          notnull: true
        cave_finale:
          type: integer
          notnull: true
      relations:
        manche:
          local: cash_game_id #On laisse vu que le champ n'est pas manche_id
          foreign: id
          foreignAlias: resultats
     
    mtt:
      columns:
        manche_id: integer
        buy_in: integer
        repartition_id: integer
      relations:
        manche:
          foreignAlias: mtts
        repartition:
          foreignAlias: repartition
     
    mttresultat:
      columns:
        mtt_id: integer
        joueur_id: integer
        place: integer
      relations:
        mtt:
          local: mtt_id
          foreign: id
          foreignAlias: Resultats
     
    resultat:
      columns:
        manche_id: integer
        joueur_id: integer
        pseudo: string(50)
        points:
          type: integer
          default: '0'
      relations:
        manche:
          foreignAlias: Resultats
     
    sng:
      columns:
        manche_id: integer
        buy_in: integer
        repartition_id: integer
      relations:
        manche:
          foreignAlias: sngs
        repartition:
          foreignAlias: sngs
     
    sngresultat:
      columns:
        sng_id: integer
        joueur_id: integer
        place: integer
      relations:
        sng:
          foreignAlias: resultats
     
    repartition:
      columns:
        repartition_schema:
          type: string(100)
          notnull: true
        repartition_label:
          type: string(50)
          notnull: true
    161 lignes, il devait rester du superflu...

    Testé.
    Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).

    • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
    • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
    • Une discussion est terminée ? Alors le bouton est votre ami !

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    19
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 19
    Points : 12
    Points
    12
    Par défaut
    merci beaucoup !

Discussions similaires

  1. Comment éviter les messages d'erreur lors de requêtes SQL
    Par Pentos60 dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 14/01/2011, 09h38
  2. [VS2008] Erreur lors du build
    Par magic-moad dans le forum Visual Studio
    Réponses: 1
    Dernier message: 20/12/2009, 18h50
  3. VB 2008 Erreur lors du Build du projet
    Par angelevil dans le forum Windows Forms
    Réponses: 1
    Dernier message: 13/02/2009, 13h28
  4. [CruiseControl] [maven2] erreur lors du build
    Par boulaxx dans le forum Intégration Continue
    Réponses: 3
    Dernier message: 28/01/2009, 14h49
  5. [Continuum] Erreur lors du build ?
    Par MakaveliFr dans le forum Intégration Continue
    Réponses: 5
    Dernier message: 24/06/2008, 17h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo