DROP TABLE IF EXISTS "public"."xxxxxx";
DROP SEQUENCE IF EXISTS "public"."xxxxxx_id_seq";
CREATE SEQUENCE "public"."xxxxxx_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
CREATE TABLE "public"."xxxxxx" (
"id" int4 NOT NULL DEFAULT nextval(‘xxxxxx_id_seq‘::regclass),
"main_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"telephone" varchar(20),
"send_message" int4,
"times" int4,
"type" int4,
"create_time" timestamp(0),
"update_time" timestamp(0)
)
;
COMMENT ON COLUMN "public"."xxxxxx"."telephone" IS ‘手机号码‘;
COMMENT ON COLUMN "public"."xxxxxx"."send_message" IS ‘是否需要发送短信‘;
COMMENT ON COLUMN "public"."xxxxxx"."times" IS ‘短信发送次数‘;
COMMENT ON COLUMN "public"."xxxxxx"."type" IS ‘发送短信类型‘;
CREATE INDEX "index_xxxxxx_main_id" ON "public"."xxxxxx" USING btree (
"main_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
GRANT Delete, Insert, Select, Truncate, Update ON TABLE "public"."xxxxxx" TO "user";
GRANT Update,Select ON TABLE "public"."xxxxxx_id_seq" TO "user";
相关文章
- 12-15自动化中常用的执行js语句
- 12-15如果为表分配了别名,那么 Transact-SQL 语句中对该表的所有显式引用都必须使用别名,而不能使用表名。
- 12-15hive总结四:建表实战训练(建表代码中涉及的知识点解析)
- 12-15Shell脚本文件中常用的操作语句
- 12-15SQL语句中----删除表数据drop、truncate和delete的用法
- 12-15SQL语句中--删除表数据drop、truncate和delete的用法
- 12-15SQL语句中删除表数据drop、truncate和delete的用法
- 12-15Java学习日志Day31_ResultSet_jdbc查询员工表_Statement执行DDL,DML语句的弊端_PreparedStatement_数据库连接池(初窥)
- 12-15js常用的语句
- 12-15sqlserver查询所有表的行数的sql语句