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 :

Création base de données Doctrine


Sujet :

ORM PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Inscrit en
    Janvier 2008
    Messages
    623
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Hauts de Seine (Île de France)

    Informations forums :
    Inscription : Janvier 2008
    Messages : 623
    Par défaut Création base de données Doctrine
    Bonjour à tous,

    je suis entrain d'apprendre à utiliser symfony et j'ai un problème au moment de la génération des tables de la base de données.

    J'ai bien crée le fichier schema.yml qui est comme ceci :

    JobeetCategory:
    actAs: { Timestampable: ~ }
    columns:
    name: { type: string(255), notnull: true, unique: true }

    JobeetJob:
    actAs: { Timestampable: ~ }
    columns:
    category_id: { type: integer, notnull: true }
    type: { type: string(255) }
    company: { type: string(255), notnull: true }
    logo: { type: string(255) }
    url: { type: string(255) }
    position: { type: string(255), notnull: true }
    location: { type: string(255), notnull: true }
    description: { type: string(4000), notnull: true }
    how_to_apply: { type: string(4000), notnull: true }
    token: { type: string(255), notnull: true, unique: true }
    is_public: { type: boolean, notnull: true, default: 1 }
    is_activated: { type: boolean, notnull: true, default: 0 }
    email: { type: string(255), notnull: true }
    expires_at: { type: timestamp, notnull: true }
    relations:
    JobeetCategory: { local: category_id, foreign: id, foreignAlias: JobeetJobs }

    JobeetAffiliate:
    actAs: { Timestampable: ~ }
    columns:
    url: { type: string(255), notnull: true }
    email: { type: string(255), notnull: true, unique: true }
    token: { type: string(255), notnull: true }
    is_active: { type: boolean, notnull: true, default: 0 }
    relations:
    JobeetCategories:
    class: JobeetCategory
    refClass: JobeetCategoryAffiliate
    local: affiliate_id
    foreign: category_id
    foreignAlias: JobeetAffiliates

    JobeetCategoryAffiliate:
    columns:
    category_id: { type: integer, primary: true }
    affiliate_id: { type: integer, primary: true }
    relations:
    JobeetCategory: { onDelete: CASCADE, local: category_id, foreign: id }
    JobeetAffiliate: { onDelete: CASCADE, local: affiliate_id, foreign: id }
    *Les espaces pour l'indentation n'ont pas l'air de fonctionner, j'ai bien indenté le texte comme sur le livre, et ce sont bien des espaces et non des tabulations.

    Au moment ou je tape la commande :
    $ php symfony doctrine:build-model
    J'ai cette erreur :



    J'ai bien chercher mais je ne vois pas ou est le problème.

    J'espère que vous pourrai m'aider.

    Merci.

  2. #2
    Membre averti
    Inscrit en
    Juin 2010
    Messages
    46
    Détails du profil
    Informations forums :
    Inscription : Juin 2010
    Messages : 46
    Par défaut
    Essaye avec ça, j'ai fais quelque modif dessus par rapport à celui dans le livre mais normalement ça devrait marcher.
    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
     
     
    JobeetAffiliate:
      connection: doctrine
      tableName: jobeet_affiliate
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        url:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        email:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        token:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        is_active:
          type: integer(1)
          fixed: false
          unsigned: false
          primary: false
          default: '0'
          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:
        JobeetCategoryAffiliate:
          local: id
          foreign: affiliate_id
          type: many
    JobeetCategory:
      connection: doctrine
      tableName: jobeet_category
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        name:
          type: string(255)
          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:
        JobeetCategoryAffiliate:
          local: id
          foreign: category_id
          type: many
        JobeetJob:
          local: id
          foreign: category_id
          type: many
      actAs:
        Timestampable: ~
        Sluggable:
          fields: [name]
      columns:
        name:
          type: string(255)
          notnull:  true	  
     
    JobeetCategoryAffiliate:
      connection: doctrine
      tableName: jobeet_category_affiliate
      columns:
        category_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: false
        affiliate_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: false
      relations:
        JobeetAffiliate:
          local: affiliate_id
          foreign: id
          type: one
        JobeetCategory:
          local: category_id
          foreign: id
          type: one
    JobeetJob:
      connection: doctrine
      tableName: jobeet_job
      columns:
        id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: true
          autoincrement: true
        category_id:
          type: integer(8)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        type:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        company:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        logo:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        url:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: false
          autoincrement: false
        position:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        location:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        description:
          type: string()
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        how_to_apply:
          type: string()
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        token:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        is_public:
          type: integer(1)
          fixed: false
          unsigned: false
          primary: false
          default: '1'
          notnull: true
          autoincrement: false
        is_activated:
          type: integer(1)
          fixed: false
          unsigned: false
          primary: false
          default: '0'
          notnull: true
          autoincrement: false
        email:
          type: string(255)
          fixed: false
          unsigned: false
          primary: false
          notnull: true
          autoincrement: false
        expires_at:
          type: timestamp(25)
          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:
        JobeetCategory:
          local: category_id
          foreign: id
          type: one

Discussions similaires

  1. [MCD]création base de données access
    Par hugue dans le forum Modélisation
    Réponses: 2
    Dernier message: 05/04/2007, 19h02
  2. Réponses: 2
    Dernier message: 08/06/2006, 20h49
  3. Création base de données Oracle sous Winwows
    Par madina dans le forum Oracle
    Réponses: 2
    Dernier message: 19/05/2006, 09h13
  4. création base de données avec easyphp
    Par Battosaiii dans le forum Débuter
    Réponses: 5
    Dernier message: 29/06/2004, 18h50

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