Nowe posty

xx Dystrybucja pod HP Omen (6)
Wczoraj o 23:30:08
xx [Poradnik] Wyszukiwanie Sterowników (2)
Wczoraj o 21:08:23
lamp Problem z Linux Lite po instalacji (0)
Wczoraj o 19:50:30
xx Ile pingwinów? (1)
Wczoraj o 08:59:24
xx konfiguracja pale moon (0)
2024-03-24, 21:53:42
xx Plasma 6 w Neonie ssie trochę mniej ... (10)
2024-03-23, 02:38:11
xx problem z instalacja sterowników do karty sieciowej (3)
2024-03-18, 18:10:16
xx Plik abc.001 (1)
2024-03-17, 17:48:27
xx Zlecę dopracowanie programu w MatLab (0)
2024-03-13, 15:28:40
xx Linux Mint 21.3 XFCE brak dźwieku po paru minutach (karta muzyczna zintegrowana) (5)
2024-03-12, 23:07:01

Autor Wątek: symfony schema.yml - blog  (Przeczytany 12898 razy)

  • Gość
symfony schema.yml - blog
« dnia: 2010-12-05, 17:47:42 »
Próbowałem zrobić plik schema.yml pod prosty blog:

user:
  actAs: { Timestampable: ~ }
  columns:
    name:        { type: string(255), unique: false, notnull: true }
    last_name:   { type: string(1024), unique: false, notnull: true }
    email:       { type: string(255), unique: true, notnull: false }
    created_at:  { type: datetime, unique: false, notnull: true }
  relations:
    userauthor:
      class: news
      local: id
      foreign: author_id  
   
news:
  actAs: { Timestampable: ~ }
  columns:
    description: { type: string(255), unique: true,  notnull: true }
    contents:    { type: string(65536), unique: true, notnull: true }
    created_at:  { type: datetime, unique: false, notnull: true }
    author_id:      { type: integer, unique: false, notnull: true }    
  relations:
    author:
      class: user
      local: author_id
      foreign: id
    tagnews:
      class: user
      refClass: newstags
      local: news_id
      foreign: tag_id  
     
tag:
  actAs: { Timestampable: ~ }
  columns:
    name: { type: string(255), unique: true, notnull: true }
    created_at: { type: datetime }
  relations:
    tagnews:
      class: news
      refClass: newstags
      local: tag_id
      foreign: news_id
     

newstags:
  actAs: { Timestampable: ~ }
  columns:
    news_id: { type: integer, unique: false, notnull: true }
    tag_id:  { type: integer, unique: false, notnull: true }
  relations:
    news:
      foreignAlias: newstag
    tag:
      foreignAlias: newstag
Jednak podczas budowania parser wyświetla mnie coś takiego:

Cytuj
SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'contents' used in key specification without a key length. Failing Query: "CREATE TABLE news (id BIGINT AUTO_INCREMENT, description VARCHAR(255) NOT NULL UNIQUE, contents TEXT NOT NULL UNIQUE, created_at DATETIME NOT NULL, author_id BIGINT NOT NULL, updated_at DATETIME NOT NULL, INDEX author_id_idx (author_id), PRIMARY KEY(id)) ENGINE = INNODB". Failing Query: CREATE TABLE news (id BIGINT AUTO_INCREMENT, description VARCHAR(255) NOT NULL UNIQUE, contents TEXT NOT NULL UNIQUE, created_at DATETIME NOT NULL, author_id BIGINT NOT NULL, updated_at DATETIME NOT NULL, INDEX author_id_idx (author_id), PRIMARY KEY(id)) ENGINE = INNODB
Co robię źle?