2013-01-07 18:42:02 +01:00
|
|
|
BEGIN;
|
|
|
|
|
|
|
|
CREATE TABLE "account" (
|
|
|
|
"id" SERIAL PRIMARY KEY,
|
|
|
|
"name" VARCHAR(200) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE "entry" (
|
|
|
|
"id" BIGSERIAL PRIMARY KEY,
|
|
|
|
"value_date" DATE NOT NULL,
|
|
|
|
"operation_date" DATE,
|
|
|
|
"label" VARCHAR(500) NOT NULL,
|
|
|
|
"comment" VARCHAR(500),
|
|
|
|
"value" NUMERIC(15,4) NOT NULL,
|
2013-01-12 22:11:48 +01:00
|
|
|
"account_id" INTEGER NOT NULL REFERENCES "account"("id"),
|
|
|
|
"category" VARCHAR(100),
|
2013-01-07 18:42:02 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX on entry(value_date);
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|