自动生成的id 被当作primary key来使用 timestamp method生成 created_at 与 updated_at columns create_table 和 drop_table 用来生成表与删除表 null:false 表明不能为null rake db:rollback  ---- 返回到上次migration之前的状态 添加与删除列: add_column :table_name, :column_name, :column_type remove_column…
As for databases, there are quit many kinds such as foxpro, mysql, sqlserver, etc. But when we need to build a project which should be portable, the .mdb(Access) databases may be one of the best choices. Here we go.:) 1.Creating a .mdb database Actua…
mysqladmin showprocesslist可查看完整sql需要权限. SHOW PROCESSLIST显示哪些线程正在运行.您也可以使用mysqladmin processlist语句得到此信息.如果您有SUPER权限,您可以看到所有线程.否则,您只能看到您自己的线程(也就是,与您正在使用的MySQL账户相关的线程).请参见13.5.5.3节,“KILL语法”.如果您不使用FULL关键词,则只显示每个查询的前100个字符. 本语句报告TCP/IP连接的主机名称(采用host_name:…
Update: Updated article here. Today I wanted to be able to have a table store any type of value as a way to store some settings for an application. The table needed to be able to store basically a name/value pair. I designed the object using a code-f…
SparkSQL从2.0开始已经不再支持ALTER TABLE table_name ADD COLUMNS (col_name data_type [COMMENT col_comment], ...)这种语法了(下文简称add columns语法).如果你的Spark项目中用到了SparkSQL+Hive这种模式,从Spark1.x升级到2.x很有可能遇到这个问题. 为了解决这个问题,我们一般有3种方案可以选择: 启动一个hiveserver2服务,通过jdbc直接调用hive,让hive执…
SparkSQL从2.0开始已经不再支持ALTER TABLE table_name ADD COLUMNS (col_name data_type [COMMENT col_comment], ...)这种语法了(下文简称add columns语法).如果你的Spark项目中用到了SparkSQL+Hive这种模式,从Spark1.x升级到2.x很有可能遇到这个问题. 为了解决这个问题,我们一般有3种方案可以选择: 启动一个hiveserver2服务,通过jdbc直接调用hive,让hive执…
Creating and Configuring a Table View Your app must present a table view to users before it can manage it in response to taps on rows and other actions. This chapter shows what you must do to create a table view, configure it, and populate it with da…
14.7 InnoDB Table Compression 14.7.1 Overview of Table Compression 14.7.2 Enabling Compression for a Table 14.7.3 Tuning Compression for InnoDB Tables 14.7.4 Monitoring Compression at Runtime 14.7.5 How Compression Works for InnoDB Tables 14.7.6 Comp…
Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Create/Drop/Truncate Table Alter Table/Partition/Column Create/Drop/Alter View Create/Drop/Alter Index Create/Drop Function Create/Drop/Grant/Revoke Roles…
13.1.17 CREATE TABLE Syntax 13.1.17.1 CREATE TABLE ... LIKE Syntax 13.1.17.2 CREATE TABLE ... SELECT Syntax 13.1.17.3 Using FOREIGN KEY Constraints 13.1.17.4 Silent Column Specification Changes CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name (creat…