inaka / sumo_db

Erlang Persistency Framework
http://inaka.github.io/sumo_db/
Apache License 2.0
174 stars 37 forks source link

Fixed issue UNIQUE constraint in sumo_store_pgsql #216

Closed antik486 closed 8 years ago

antik486 commented 8 years ago

Fixed issue UNIQUE constraint in sumo_store_pgsql

sumo_schema() ->
    Fields = [
              sumo:new_field(id,          integer,  [id, auto_increment]),
              sumo:new_field(key,         integer,  [not_null, unique]),
              sumo:new_field(value,       string,   [{length, 255}, not_null]),
              sumo:new_field(created_at,  datetime, [not_null])
             ],
    sumo:new_schema(?MODULE, Fields).
{error,{mytrails,{{error,error,<<"42601">>,
                         <<"syntax error at or near \"KEY\"">>,
                         [{position,<<"184">>}]},
                  {mytrails_app,start_phase,
                                [create_trail_schema,normal,[]]}}}}