mirror of https://github.com/sipwise/db-schema.git
Extend billing.journals with fields required for RBAC for journals. Added fields: - reseller_id to limit reseller admins to their reseller - user_id to reference admins or subscribers - tx_id unique transaction id - role defining the access scope the entry was created with Change-Id: Id4a093a3ea668914d6f3214f79955d89b58263dbmr10.2
parent
03d22cb20b
commit
2c457567fe
@ -0,0 +1,11 @@
|
||||
USE billing;
|
||||
|
||||
ALTER TABLE journals
|
||||
DROP FOREIGN KEY `j_resellerid_ref`,
|
||||
DROP KEY `resellerid_idx`,
|
||||
DROP KEY `userid_idx`,
|
||||
DROP KEY `txid_idx`,
|
||||
DROP COLUMN `reseller_id`,
|
||||
DROP COLUMN `user_id`,
|
||||
DROP COLUMN `tx_id`,
|
||||
DROP COLUMN `role`;
|
||||
@ -0,0 +1,11 @@
|
||||
USE billing;
|
||||
|
||||
ALTER TABLE journals
|
||||
ADD COLUMN `reseller_id` int(11) unsigned DEFAULT NULL,
|
||||
ADD KEY `resellerid_idx` (`reseller_id`),
|
||||
ADD COLUMN `user_id` int(11) unsigned DEFAULT NULL,
|
||||
ADD KEY `userid_idx` (`user_id`),
|
||||
ADD COLUMN `role` varchar(64) DEFAULT NULL,
|
||||
ADD COLUMN `tx_id` varchar(36) DEFAULT NULL,
|
||||
ADD UNIQUE KEY `txid_idx` (`tx_id`),
|
||||
ADD CONSTRAINT `j_resellerid_ref` FOREIGN KEY (`reseller_id`) REFERENCES `resellers` (`id`);
|
||||
Loading…
Reference in new issue