diff --git a/sql/2016-06-01-notifications.sql b/sql/2016-06-01-notifications.sql new file mode 100644 index 0000000..1524230 --- /dev/null +++ b/sql/2016-06-01-notifications.sql @@ -0,0 +1,24 @@ +-- Recent additions to add after db init (.gz) +-- mysql yaamp -p < file.sql + +CREATE TABLE `notifications` ( + `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `idcoin` int(11) NOT NULL, + `enabled` int(1) NOT NULL DEFAULT '0', + `description` varchar(128) NULL, + `conditiontype` varchar(32) NULL, + `conditionvalue` double NULL, + `notifytype` varchar(32) NULL, + `notifycmd` varchar(512) NULL, + `lastchecked` int(10) UNSIGNED NOT NULL, + `lasttriggered` int(10) UNSIGNED NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- KEYS + +ALTER TABLE `notifications` + ADD KEY `notif_coin` (`idcoin`), + ADD INDEX `notif_checked` (`lastchecked`); + +ALTER TABLE `notifications` ADD CONSTRAINT fk_notif_coin FOREIGN KEY (`idcoin`) + REFERENCES coins (`id`) ON DELETE CASCADE; diff --git a/web/yaamp/models/db_notificationsModel.php b/web/yaamp/models/db_notificationsModel.php new file mode 100644 index 0000000..c4ba0aa --- /dev/null +++ b/web/yaamp/models/db_notificationsModel.php @@ -0,0 +1,35 @@ + array(self::BELONGS_TO, 'db_coins', 'idcoin', 'alias'=>'nc'), + ); + } + + public function attributeLabels() + { + return array( + ); + } +} +