- 19 4月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
I'm not sure why `Mysql2VirtualColumnTest#test_schema_dumping` passed previously. But now the test not pass at least in MariaDB 10.1.9. I fixed the regexp to respect `COLLATE`. ``` % ARCONN=mysql2 be ruby -w -Itest test/cases/adapters/mysql2/virtual_column_test.rb -n test_schema_dumping Using mysql2 Run options: -n test_schema_dumping --seed 7131 F Finished in 0.466304s, 2.1445 runs/s, 4.2890 assertions/s. 1) Failure: Mysql2VirtualColumnTest#test_schema_dumping [test/cases/adapters/mysql2/virtual_column_test.rb:55]: Expected /t\.virtual\s+"upper_name",\s+type: :string,\s+as: "UPPER\(`name`\)"$/i to match "# This file is auto-generated from the current state of the database. Instead\n# of editing this file, please use the migrations feature of Active Record to\n# incrementally modify your database, and then regenerate this schema definition.\n#\n# Note that this schema.rb definition is the authoritative source for your\n# database schema. If you need to create the application database on another\n# system, you should be using db:schema:load, not running all the migrations\n# from scratch. The latter is a flawed and unsustainable approach (the more migrations\n# you'll amass, the slower it'll run and the greater likelihood for issues).\n#\n# It's strongly recommended that you check this file into your version control system.\n\nActiveRecord::Schema.define(version: 0) do\n\n create_table \"virtual_columns\", force: :cascade, options: \"ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\" do |t|\n t.string \"name\"\n t.virtual \"upper_name\", type: :string, as: \n t.virtual \"name_length\", type: :integer, as: \"LENGTH(`name`)\", stored: true\n end\n\nend\n". 1 runs, 2 assertions, 1 failures, 0 errors, 0 skips ``` ``` > select @@version; +--------------------+ | @@version | +--------------------+ | 10.1.9-MariaDB-log | +--------------------+ 1 row in set (0.00 sec) ```
-
由 Ryuta Kamizono 提交于
Related #28399.
-
- 23 2月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
The native timestamp type in MySQL is different from datetime type. Internal representation of the timestamp type is UNIX time, This means that timestamp columns are affected by time zone. ``` > SET time_zone = '+00:00'; Query OK, 0 rows affected (0.00 sec) > INSERT INTO time_with_zone(ts,dt) VALUES (NOW(),NOW()); Query OK, 1 row affected (0.02 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 22:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) > SET time_zone = '-08:00'; Query OK, 0 rows affected (0.00 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 14:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) ```
-
- 11 2月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently schema dumper lost the unsigned option when primary key is defined as bigint with unsigned. This commit fixes the issue. Closes #27960
-
- 07 2月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
`ColumnDumper#migration_keys` was extracted to customize keys for standardized column arguments widths. But the feature was removed in df84e986. The internal method is no longer used for that.
-
- 04 2月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
The PR #27384 changed integer-like primary key to be autoincrement unless an explicit default. This means that integer-like primary key is restored as autoincrement unless dumping the default nil explicitly. We should dump integer-like primary key with default nil correctly.
-
- 02 2月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
MySQL generated columns: https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html MariaDB virtual columns: https://mariadb.com/kb/en/mariadb/virtual-computed-columns/ Declare virtual columns with `t.virtual name, type: …, as: "expression"`. Pass `stored: true` to persist the generated value (false by default). Example: create_table :generated_columns do |t| t.string :name t.virtual :upper_name, type: :string, as: "UPPER(name)" t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true t.index :name_length # May be indexed, too! end Closes #22589
-
- 18 1月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
* Don't force PKs on tables that have explicitly opted out * All integer-like PKs are autoincrement unless they have an explicit default
-
- 06 12月, 2016 1 次提交
-
-
由 Jon McCartie 提交于
-
- 26 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to 99cf7558.
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 12 3月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to #18228. In MySQL and PostgreSQL, primary key is to be `NOT NULL` implicitly. But in SQLite it must be specified `NOT NULL` explicitly.
-
- 11 3月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 08 3月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently the results of `column.serial?` is not correct. For `column.serial?` correctly working, initialize `column.table_name` immediately.
-
- 04 3月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 29 2月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Actually `:name` and `:type` are not column options.
-
- 08 2月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
A return value of `schema_type` is used by: 1. primary key type: using as `symbol.inspect` 2. normal column type: using as `symbol.to_s` It is better to return symbol.
-
- 02 11月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Such as #10404, #18206.
-
- 15 10月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently `tinyblob` is dumped to `t.binary "tiny_blob", limit: 255`. But `t.binary ... limit: 255` is generating SQL to `varchar(255)`. It is incorrect. This commit fixes this problem.
-
- 13 10月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Current master branch includes many schema dumping improvements. It extract these features to the appropriate files.
-