 
 create table transaction (
   id                        bigint auto_increment not null,
-  invalid                   tinyint(1) default 0,
-  created                   datetime,
+  invalid                   tinyint(1) not null default 0,
+  created                   datetime not null,
   user_id                   bigint not null,
   paytype_id                bigint not null,
   constraint pk_transaction primary key (id))

  id                        bigint auto_increment not null,
  name                      varchar(255) not null,
  price                     decimal(38) not null,
  quantity                  integer,
  constraint pk_product primary key (id))
;

create table status (
  id                        bigint auto_increment not null,
  name                      varchar(255),
  constraint pk_status primary key (id))
;

create table stocktaking (
  id                        bigint auto_increment not null,
  created                   datetime,
  users                     longtext,
  products                  longtext,
  transactions              longtext,

  id                        bigint auto_increment not null,
  name                      varchar(255) not null,
  price                     decimal(38) not null,
  quantity                  integer not null,
  transaction_id            bigint not null,
  product_id                bigint not null,
  constraint pk_transaction_product primary key (id))
;

