1
我正在使用boss_db一个小项目,并有一个问题,我没有能够从文档解密。boss_db问题,同时保存记录
这里是我的Postgres数据库表:
CREATE TABLE recordings (
recording_id uuid PRIMARY KEY,
created timestamp NOT NULL,
cid_name text DEFAULT '',
cid_number text NOT NULL,
destination_number text NOT NULL,
file_path text NOT NULL,
message_len integer,
archived boolean DEFAULT false
);
这里是我的模型文件:
-module(recording, [Id::uuid(),
Created::datetime(),
CidName::string(),
CidNumber::string(),
DestinationNumber::string(),
FilePath::string(),
MessageLen::integer(),
Archived::boolean()
]).
下面是什么在控制台上发生的事情:
1> myproto:start().
{ok,<0.34.0>}
2> {ok, recording} = boss_record_compiler:compile("recording.erl").
{ok,recording}
3> Recording = recording:new(id, {{2012, 12, 20}, {18, 19, 20}}, "", "1002", "1000", "/usr/local/freeswitch/encodings/2012-12-20-13-17-36_1000_1002.ogg", 260, false).
{recording,id,
{{2012,12,20},{18,19,20}},
[],"1002","1000",
"/usr/local/freeswitch/encodings/2012-12-20-13-17-36_1000_1002.ogg",
260,false}
4> Recording:save().
{error,{error,error,<<"42703">>,
<<"column \"id\" of relation \"recordings\" does not exist">>,
[{position,<<"110">>}]}}