All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.killbill.queue.notifications_mysql.sql Maven / Gradle / Ivy

/*! SET default_storage_engine=INNODB */;

CREATE TABLE ${tableName} (
                               record_id serial unique,
                               class_name varchar(256) NOT NULL,
                               event_json mediumtext NOT NULL,
                               user_token varchar(36),
                               created_date datetime NOT NULL,
                               creating_owner varchar(50) NOT NULL,
                               processing_owner varchar(50) DEFAULT NULL,
                               processing_available_date datetime DEFAULT NULL,
                               processing_state varchar(14) DEFAULT 'AVAILABLE',
                               error_count int /*! unsigned */ DEFAULT 0,
                               search_key1 bigint /*! unsigned */ default null,
                               search_key2 bigint /*! unsigned */ default null,
                               queue_name varchar(64) NOT NULL,
                               effective_date datetime NOT NULL,
                               future_user_token varchar(36),
                               PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX idx_comp_where ON ${tableName}(effective_date, processing_state, processing_owner, processing_available_date);
CREATE INDEX idx_update ON ${tableName}(processing_state, processing_owner, processing_available_date);
CREATE INDEX idx_get_ready ON ${tableName}(effective_date, created_date);
CREATE INDEX notifications_search_keys ON ${tableName}(search_key2, search_key1);

CREATE TABLE ${historyTableName} (
                                       record_id serial unique,
                                       class_name varchar(256) NOT NULL,
                                       event_json mediumtext NOT NULL,
                                       user_token varchar(36),
                                       created_date datetime NOT NULL,
                                       creating_owner varchar(50) NOT NULL,
                                       processing_owner varchar(50) DEFAULT NULL,
                                       processing_available_date datetime DEFAULT NULL,
                                       processing_state varchar(14) DEFAULT 'AVAILABLE',
                                       error_count int /*! unsigned */ DEFAULT 0,
                                       search_key1 bigint /*! unsigned */ default null,
                                       search_key2 bigint /*! unsigned */ default null,
                                       queue_name varchar(64) NOT NULL,
                                       effective_date datetime NOT NULL,
                                       future_user_token varchar(36),
                                       PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX notifications_history_search_keys ON ${historyTableName}(search_key2, search_key1);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy