braginini / floriparide-listings

business listings
0 stars 0 forks source link

Create journaling table #2

Closed braginini closed 10 years ago

braginini commented 10 years ago

Create a table for journaling operations over table public.branch

  1. Create new schema "journal"
  2. Create table "journal.j_branch" with following fields:
    • id (bigint autoincrement, pk, nullable=false)
    • source_id (bigint, nullable=false) - reference to the main table "public.branch". No FK
    • operation_type (create type operation_type (CREATE,UPDATE,DELETE, nullable=false)
    • timestamp (bigint, nullable=false) - timestamp of the operation
    • data (json) - the data of the operation performed. When CREATE or UPDATE should contain the whole data from src table. WHen DELETE - null