Drupal Schema module from existing database to hook_schema

Source: Internet
Author: User
Tags numeric mysql version drupal

Drupal Schema module


The Schema API allows the module to declare a database in the Form of a structured array (similar to the Form API), and provides API functions for creating, deleting, and modifying data tables, columns, keys, and indexes.


The Schema module provides some functions other than the Schema API of the Drupal core architecture. Currently, this includes:

Schema document: an embedded document that displays Schema in hyperlink form is used to explain what each data table and field is doing.
Schema structure generation: the Schema module can check the real-time database and create the Schema API data structure of all tables in the matched real-time database.
Schema comparison: the Schema module compares the real-time database structure with the schema structure defined by all enabled modules to report any lost or incorrect tables.
MySQL considerations: the Schema module requires MySQL version 5 or later. MySQL versions earlier than MySQL do not support the Schema module to check the INFORMATION_SCHEMA database in the database.

Type Size MySQL type & size/range
Serial Tiny Tinyint, 1 B
Serial Small Smallint, 2 B
Serial Medium Mediumint, 3 B
Serial Big Bigint, 8 B
Serial Normal Int, 4 B
Int Tiny Tinyint, 1 B
Int Small Smallint, 2 B
Int Medium Mediumint, 3 B
Int Big Bigint, 8 B
Int Normal Int, 4 B
Float Tiny Float, 4 B
Float Small Float, 4 B
Float Medium Float, 4 B
Float Big Double, 8 B
Float Normal Float, 4 B
Numeric Normal Numeric, 65 digits
Varchar Normal Varchar, 255 B (D6) or 64 KB (D7 and later)1
Char Normal Char, 255 B
Text Tiny Tinytext, 256 B
Text Small Tinytext, 256 B
Text Medium Mediumtext, 16 MB
Text Big Longtext, 4 GB
Text Normal Text, 16 KB
Blob Big Longblob, 4 GB
Blob Normal Blob, 16 KB

Download the Schema module:

Http://drupal.org/project/schema

Original article from: blog.lixiphp.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.