Forum Linux.pl

Programowanie => PHP, *SQL => Wątek zaczęty przez: w 2010-03-18, 15:20:41

Tytuł: Symphony baza w YAML
Wiadomość wysłana przez: w 2010-03-18, 15:20:41
Próbowałem w YAML stworzyć sobie bazę:

Jednak przy generowaniu wyświetliło mnie sie:

Cytuj
tomasz@tomasz-laptop:~/project/symfony$ ./symfony doctrine:build-schema
>> doctrine  generating yaml schema from database

                                           
  No models generated from your databases
# config/schema.yml

propel:
   articles_category:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      name:          { type: varchar(255), required, index: unique }
      description:   { type: varchar(255) }
      parent:        { type: integer }
      visible:       { type: boolean }
      creation_date: { type: timestamp }
      moderator:     { type: integer }
      group:         { type: integer, required }

   articles_entries:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      description:   { type: string(255), required, index: unique }
      content:       { type: string (65535) }
      category:      { type: integer }
      visible:       { type: boolean }
      creation_date: { type: timestamp }
      author:        { type: integer }
     
   users:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      login:         { type: varchar (32) }
      password:      { type: varchar (32) }
      name:          { type: varchar (255) }
      last_name:     { type: varchar (255) }
      creation_date  { type: timestamp }
      blocked:       { type: boolean }
Co robię nie tak?
Tytuł: Symphony baza w YAML
Wiadomość wysłana przez: ZipoKing w 2010-03-18, 15:39:27
1. Plik ze schematem bazy danych powinien być w config/doctrine/schema.yml a nie config/schema.yml (tej lokalizacji używa Propel, a widzę że używasz Doctrine)
2. Pierwszy wiersz - nie jestem pewny czy to ma jakieś znaczenie, ale zamień "propel" na "doctrine"
Tytuł: Symphony baza w YAML
Wiadomość wysłana przez: w 2010-03-18, 15:56:48
Hmm... nadal nie działa

# config/doctrine/schema.yml

doctrine:
   articles_category:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      name:          { type: varchar(255), required, index: unique }
      description:   { type: varchar(255) }
      parent:        { type: integer }
      visible:       { type: boolean }
      creation_date: { type: timestamp }
      moderator:     { type: integer }
      group:         { type: integer, required }

   articles_entries:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      description:   { type: string(255), required, index: unique }
      content:       { type: string (65535) }
      category:      { type: integer }
      visible:       { type: boolean }
      creation_date: { type: timestamp }
      author:        { type: integer }
     
   users:
     actAs: { Timestampable: ~ }
     columns:
      id:            ~
      login:         { type: varchar (32) }
      password:      { type: varchar (32) }
      name:          { type: varchar (255) }
      last_name:     { type: varchar (255) }
      creation_date  { type: timestamp }
      blocked:       { type: boolean }
Tytuł: Symphony baza w YAML
Wiadomość wysłana przez: w 2010-03-18, 16:02:37
Zdaje mnie się też żę generator pliku nie widzi, bo nawet wpisałem zupełnie błędne dane a on nic nadal to samo. Jednak zdaje mnie się, że plik schema.yml mam teraz w dobrej lokalizacji?? mam go w /home/tomasz/project/symfony/config/doctrine/schema.yml