<commit_before>CREATE TABLE OPENBILL_LOCKS (
  id              UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  owner_id        UUID,
  username        character varying(255) not null,
  date            date default current_date not null,
  created_at      timestamp without time zone default current_timestamp,
  account_id uuid not null,
  amount_cents    numeric not null,
  amount_currency character varying(8) not null,
  key             character varying(256) UNIQUE not null,
  details         text not null,
  meta            hstore not null default ''::hstore,
  lock_key   character varying(256),
  foreign key (lock_key) REFERENCES OPENBILL_LOCKS (key) ON DELETE RESTRICT ON UPDATE RESTRICT,
  foreign key (account_id) REFERENCES OPENBILL_ACCOUNTS (id) ON DELETE RESTRICT ON UPDATE RESTRICT
);

CREATE UNIQUE INDEX index_locks_on_key ON OPENBILL_LOCKS USING btree (key);
CREATE INDEX index_locks_on_meta ON OPENBILL_LOCKS USING gin (meta);

ALTER TABLE openbill_accounts ADD COLUMN locked_cents numeric not null DEFAULT 0;<commit_msg>issue #19. hstore -> jsonb<commit_after>CREATE TABLE OPENBILL_LOCKS (
  id              UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  owner_id        UUID,
  username        character varying(255) not null,
  date            date default current_date not null,
  created_at      timestamp without time zone default current_timestamp,
  account_id uuid not null,
  amount_cents    numeric not null,
  amount_currency character varying(8) not null,
  key             character varying(256) UNIQUE not null,
  details         text not null,
  meta            jsonb not null default '{}'::jsonb,
  lock_key   character varying(256),
  foreign key (lock_key) REFERENCES OPENBILL_LOCKS (key) ON DELETE RESTRICT ON UPDATE RESTRICT,
  foreign key (account_id) REFERENCES OPENBILL_ACCOUNTS (id) ON DELETE RESTRICT ON UPDATE RESTRICT
);

CREATE UNIQUE INDEX index_locks_on_key ON OPENBILL_LOCKS USING btree (key);
CREATE INDEX index_locks_on_meta ON OPENBILL_LOCKS USING gin (meta);

ALTER TABLE openbill_accounts ADD COLUMN locked_cents numeric not null DEFAULT 0;
{'fraction_non_alphanumeric': 0.04859456884230586, 'fraction_numerical': 0.012386850881372083, 'mean_word_length': 3.6357615894039736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '743808', 'n_tokens_mistral': 678, 'n_tokens_neox': 621, 'n_words': 228}