Commit 39126622 authored by doc@bgerp.org's avatar doc@bgerp.org

p12147 rename_table SQL update stored procedure.

parent 3bfd863d
A: Хранимая SQL процедура rename_table для безопасного переименования таблиц при обновлениях.
\ No newline at end of file
This diff is collapsed.
CREATE TABLE IF NOT EXISTS fulltext_data (
object_type VARCHAR(100) NOT NULL,
object_id INT NOT NULL,
scheduled_dt DATETIME,
data TEXT NOT NULL,
FULLTEXT (data) WITH PARSER ngram,
KEY scheduled_dt (scheduled_dt),
UNIQUE KEY type_id (object_type, object_id)
object_type VARCHAR(100) NOT NULL,
object_id INT NOT NULL,
scheduled_dt DATETIME,
data TEXT NOT NULL,
FULLTEXT (data) WITH PARSER ngram,
KEY scheduled_dt (scheduled_dt),
UNIQUE KEY type_id (object_type, object_id)
);
-- ! после должен быть только перенос строки !;
CREATE TABLE IF NOT EXISTS task (
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
type_id VARCHAR(20) NOT NULL,
process_id INT NOT NULL,
scheduled_dt DATETIME,
executed_dt DATETIME,
config TEXT NOT NULL,
log TEXT NOT NULL,
KEY process_id(process_id),
KEY scheduled_dt(scheduled_dt),
KEY executed_dt(executed_dt)
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
type_id VARCHAR(20) NOT NULL,
process_id INT NOT NULL,
scheduled_dt DATETIME,
executed_dt DATETIME,
config TEXT NOT NULL,
log TEXT NOT NULL,
KEY process_id(process_id),
KEY scheduled_dt(scheduled_dt),
KEY executed_dt(executed_dt)
);
CALL add_column_if_not_exists('task', 'config', 'TEXT NOT NULL');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment