WordPress-文章 - MySQL数据库表结构设计

yesapi_wp_posts
字段数:23 分类:cms 使用次数:6

WordPress-文章 是一个MySQL数据库表,表名为 yesapi_wp_posts, 共包含 23 个字段。 所属分类:cms。 该表提供了完整的字段定义、类型说明、默认值、索引设计和示例数据,可直接用于MySQL数据库建表。

💡 使用方式:复制下方SQL语句到MySQL客户端执行即可创建此表;也可通过果创云一键创建并生成RESTful API接口,免去手动部署。

MySQL数据库表结构设计

第 1-23 条, 共 23 条.
字段名称字段类型字段默认值是否允许为空字段描述索引字段数据示例
IDbigint(20)无索引
post_authorbigint(20)0普通索引0
post_datedatetime0000-00-00 00:00:00无索引0000-00-00 00:00:00
post_date_gmtdatetime0000-00-00 00:00:00无索引0000-00-00 00:00:00
post_contentlongtext无索引
post_titletext无索引
post_excerpttext无索引
post_statusvarchar(20)publish无索引publish
comment_statusvarchar(20)open无索引open
ping_statusvarchar(20)open无索引open
post_passwordvarchar(255)无索引
post_namevarchar(200)普通索引
to_pingtext无索引
pingedtext无索引
post_modifieddatetime0000-00-00 00:00:00无索引0000-00-00 00:00:00
post_modified_gmtdatetime0000-00-00 00:00:00无索引0000-00-00 00:00:00
post_content_filteredlongtext无索引
post_parentbigint(20)0普通索引0
guidvarchar(255)无索引
menu_orderint(11)0无索引0
post_typevarchar(20)post普通索引post
post_mime_typevarchar(100)无索引
comment_countbigint(20)0无索引0

MySQL建表SQL语句

来源:WordPress-文章  |  链接:https://open.yesapi.cn/tablelist/yesapi_wp_posts.html

SQL
-- 数据库大全:WordPress-文章
-- 来源:YesApi.cn
CREATE TABLE `yesapi_wp_posts` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `ID` bigint(20) NOT NULL COMMENT '',
    `post_author` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
    `post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '',
    `post_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '',
    `post_content` longtext NOT NULL COMMENT '',
    `post_title` text NOT NULL COMMENT '',
    `post_excerpt` text NOT NULL COMMENT '',
    `post_status` varchar(20) NOT NULL DEFAULT 'publish' COMMENT '',
    `comment_status` varchar(20) NOT NULL DEFAULT 'open' COMMENT '',
    `ping_status` varchar(20) NOT NULL DEFAULT 'open' COMMENT '',
    `post_password` varchar(255) NOT NULL COMMENT '',
    `post_name` varchar(200) NOT NULL COMMENT '',
    `to_ping` text NOT NULL COMMENT '',
    `pinged` text NOT NULL COMMENT '',
    `post_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '',
    `post_modified_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '',
    `post_content_filtered` longtext NOT NULL COMMENT '',
    `post_parent` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
    `guid` varchar(255) NOT NULL COMMENT '',
    `menu_order` int(11) NOT NULL DEFAULT '0' COMMENT '',
    `post_type` varchar(20) NOT NULL DEFAULT 'post' COMMENT '',
    `post_mime_type` varchar(100) NOT NULL COMMENT '',
    `comment_count` bigint(20) NOT NULL DEFAULT '0' COMMENT '',
    KEY `post_author` (`post_author`),
    KEY `post_name` (`post_name`),
    KEY `post_parent` (`post_parent`),
    KEY `post_type` (`post_type`),
    PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT 'WordPress-文章';

复制后,到数据库执行,即可创建此数据库表。

📖 如何使用 WordPress-文章 数据库表

  1. 手动建表:复制上方SQL语句,在MySQL客户端(如Navicat、phpMyAdmin、命令行)中执行即可
  2. 一键创建:点击「立即免费创建此表」按钮,果创云自动生成表和RESTful API接口
  3. API调用:创建表后,即可通过HTTP接口对数据进行增删改查操作
  4. 二次开发:支持自定义字段、添加业务逻辑、生成小程序/APP后端接口

❓ 常见问题

Q:WordPress-文章表的主键是什么?
A:主键为 id 字段,类型为 bigint(20) unsigned NOT NULL AUTO_INCREMENT,自增无符号整数。
Q:如何在项目中使用这张表?
A:可以直接复制建表SQL到MySQL数据库中执行创建,也可以通过果创云平台一键创建并自动生成RESTful API接口,无需手动部署。
Q:这张表的索引有哪些?
A:post_author(普通索引)、post_name(普通索引)、post_parent(普通索引)、post_type(普通索引),以及主键索引(id)。

猜你喜欢

回到顶部 ↑