建表
CREATE TABLE your_table (id INT PRIMARY KEY AUTO_INCREMENT,name VARCHAR(255),remark remark TEXT,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
已有表添加字段
ALTER TABLE your_table
-- ADD COLUMN name VARCHAR(255),
ADD COLUMN remark TEXT,
ADD COLUMN createdtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN updatedtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
已有字段修改
ALTER TABLE your_table
MODIFY COLUMN remark TEXT;