Skip to content

Commit

Permalink
feat(server/invoices): initial db stucture
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Aug 30, 2024
1 parent af5675c commit 29191ca
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sql/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,29 @@ CREATE TABLE IF NOT EXISTS `accounts_transactions` (
CONSTRAINT `accounts_transactions_toId_fk` FOREIGN KEY (`toId`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE IF NOT EXISTS `accounts_invoices`
(
`id` INT UNSIGNED AUTO_INCREMENT
PRIMARY KEY,
`payerId` INT UNSIGNED NULL,
`fromId` INT UNSIGNED NOT NULL,
`toId` INT UNSIGNED NOT NULL,
`amount` INT UNSIGNED NOT NULL,
`message` VARCHAR(255) NULL,
`date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP() NOT NULL,
CONSTRAINT `accounts_invoices_accounts_id_fk`
FOREIGN KEY (`fromId`) REFERENCES `accounts` (`id`),
CONSTRAINT `accounts_invoices_accounts_id_fk_2`
FOREIGN KEY (`toId`) REFERENCES `accounts` (`id`),
CONSTRAINT `accounts_invoices_characters_charId_fk`
FOREIGN KEY (`payerId`) REFERENCES `characters` (`charId`)
);






/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;

/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
Expand Down

0 comments on commit 29191ca

Please sign in to comment.