Add first routes for accounts management
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
DROP TABLE IF EXISTS inbox;
 | 
			
		||||
DROP TABLE IF EXISTS movement;
 | 
			
		||||
DROP TABLE IF EXISTS account;
 | 
			
		||||
DROP TABLE IF EXISTS attachment;
 | 
			
		||||
DROP TABLE IF EXISTS token;
 | 
			
		||||
DROP TABLE IF EXISTS movements;
 | 
			
		||||
DROP TABLE IF EXISTS accounts;
 | 
			
		||||
DROP TABLE IF EXISTS attachments;
 | 
			
		||||
DROP TABLE IF EXISTS tokens;
 | 
			
		||||
DROP TABLE IF EXISTS users;
 | 
			
		||||
@@ -7,7 +7,7 @@ CREATE TABLE users
 | 
			
		||||
    time_update BIGINT       NOT NULL
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
CREATE TABLE token
 | 
			
		||||
CREATE TABLE tokens
 | 
			
		||||
(
 | 
			
		||||
    id               SERIAL PRIMARY KEY,
 | 
			
		||||
    name             VARCHAR(150) NOT NULL,
 | 
			
		||||
@@ -25,7 +25,7 @@ CREATE TABLE token
 | 
			
		||||
    right_auth       BOOLEAN      NOT NULL DEFAULT false
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
CREATE TABLE attachment
 | 
			
		||||
CREATE TABLE attachments
 | 
			
		||||
(
 | 
			
		||||
    id          SERIAL PRIMARY KEY,
 | 
			
		||||
    time_create BIGINT       NOT NULL,
 | 
			
		||||
@@ -35,7 +35,7 @@ CREATE TABLE attachment
 | 
			
		||||
    user_id     INTEGER      NOT NULL REFERENCES users ON DELETE SET NULL
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
CREATE TABLE account
 | 
			
		||||
CREATE TABLE accounts
 | 
			
		||||
(
 | 
			
		||||
    id              SERIAL PRIMARY KEY,
 | 
			
		||||
    name            VARCHAR(50) NOT NULL,
 | 
			
		||||
@@ -45,13 +45,13 @@ CREATE TABLE account
 | 
			
		||||
    default_account BOOLEAN     NOT NULL DEFAULT false
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
CREATE TABLE movement
 | 
			
		||||
CREATE TABLE movements
 | 
			
		||||
(
 | 
			
		||||
    id            SERIAL PRIMARY KEY,
 | 
			
		||||
    account_id    INTEGER      NOT NULL REFERENCES account ON DELETE CASCADE,
 | 
			
		||||
    account_id    INTEGER      NOT NULL REFERENCES accounts ON DELETE CASCADE,
 | 
			
		||||
    time          BIGINT       NOT NULL,
 | 
			
		||||
    label         VARCHAR(200) NOT NULL,
 | 
			
		||||
    attachment_id INT          REFERENCES attachment ON DELETE SET NULL,
 | 
			
		||||
    attachment_id INT          REFERENCES attachments ON DELETE SET NULL,
 | 
			
		||||
    amount        REAL         NOT NULL,
 | 
			
		||||
    checked       BOOLEAN      NOT NULL DEFAULT false,
 | 
			
		||||
    time_create   BIGINT       NOT NULL,
 | 
			
		||||
@@ -61,9 +61,9 @@ CREATE TABLE movement
 | 
			
		||||
CREATE TABLE inbox
 | 
			
		||||
(
 | 
			
		||||
    id            SERIAL PRIMARY KEY,
 | 
			
		||||
    attachment_id INTEGER NOT NULL REFERENCES attachment ON DELETE CASCADE,
 | 
			
		||||
    attachment_id INTEGER NOT NULL REFERENCES attachments ON DELETE CASCADE,
 | 
			
		||||
    user_id       INTEGER NOT NULL REFERENCES users ON DELETE CASCADE,
 | 
			
		||||
    account_id    INTEGER REFERENCES account ON DELETE CASCADE,
 | 
			
		||||
    account_id    INTEGER REFERENCES accounts ON DELETE CASCADE,
 | 
			
		||||
    time_create   BIGINT  NOT NULL,
 | 
			
		||||
    time_update   BIGINT  NOT NULL
 | 
			
		||||
);
 | 
			
		||||
		Reference in New Issue
	
	Block a user