Nowe posty

xx Problem ze sterownikami. (5)
2024-04-13, 21:25:16
xx Instalacja xfce4 (2)
2024-04-13, 16:20:17
xx Serie kompilacji bez instalacji dla “emerge” w Gentoo (2)
2024-04-08, 18:40:04
xx Plasma 6 w Neonie ssie trochę mniej ... (17)
2024-04-05, 10:03:46
xx Problem z Linux Lite po instalacji (3)
2024-04-03, 14:23:40
xx Jak właczyć num locka przy starcie systemu debian 12? (12)
2024-04-02, 17:43:54
xx Brak dźwieku w systemie. (5)
2024-04-02, 16:13:41
xx Dystrybucja pod HP Omen (7)
2024-03-29, 11:33:05
xx [Poradnik] Wyszukiwanie Sterowników (2)
2024-03-27, 21:08:23
xx Ile pingwinów? (1)
2024-03-27, 08:59:24

Autor Wątek: symfony schema.yml - blog  (Przeczytany 12904 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?