aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
Commit message (Collapse)AuthorAgeFilesLines
* Don't use send when we own the methodRafael Mendonça França2014-03-261-34/+34
|
* Invert the conditionals to make easier to readRafael Mendonça França2014-03-261-4/+4
| | | | Also improve some of the code conventions
* Fixes bugs for using indexes in CREATE TABLE by adding checks for table ↵Steve Rice2014-03-251-1/+1
| | | | | | | | existence Also: - updates tests by stubbing table_exists? method - adds entry for creating indexes in CREATE TABLE to changelog
* create indexes inline in CREATE TABLE for MySQLCody Cutrer2014-03-251-11/+10
| | | | | | | | This is important, because adding an index on a temporary table after it has been created would commit the transaction Conflicts: activerecord/CHANGELOG.md
* Add missing parantheses in index_exists?Yannick Schutz2014-02-251-1/+1
|
* docs, AR already auto-detects primary keys. Closes #13946. [ci skip]Yves Senn2014-02-051-3/+3
| | | | | This behavior was introduced since Rails 3.1 (207f266ccaaa9cd04cd2a7513ae5598c4358b510) but the docs were still out of date.
* Make change_table use object of current database adapterNishant Modak2014-01-071-5/+5
| | | | | | | | | - Earlier, change_table was creating database-agnostic object. - After this change, it will create correct object based on current database adapter. - This will ensure that create_table and change_table will get same objects. - This makes update_table_definition method public and nodoc. - Fixes #13577 and #13503
* Fix missing closing rdoc tag [ci skip]Carlos Antonio da Silva2013-12-161-1/+1
|
* support creating temporary tables from queriesCody Cutrer2013-12-141-10/+25
| | | | | also override drop_table in AbstractMySQLAdapter to properly drop temporary tables without committing the transaction
* `connection.type_to_sql` returns a `String` for unmapped types.Yves Senn2013-12-031-1/+1
| | | | | | | | | | Closes #13146. This fixes an error when using: ``` change_colum :table, :column, :bigint, array: true ```
* `rename_index`: add the new index before removing the old one.Yves Senn2013-11-261-2/+2
| | | | | | | | | | | This prevents the following error when a MySQL index on a foreign key column is renamed: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint: DROP INDEX `index_engines_on_car_id` ON `engines` ``` refs: #13038.
* Removed deprecated method `columns_for_remove`Neeraj Singh2013-07-031-6/+0
|
* Remove deprecated SchemaStatements#distinctFrancesco Rodriguez2013-07-021-9/+0
|
* Fix documents for create_join_tableSatoshi Ebisawa2013-06-211-2/+2
|
* Merge pull request #10425 from ↵Rafael Mendonça França2013-06-131-11/+0
|\ | | | | | | | | ranjaykrishna/push_add_column_options_to_schema_creation Push add column options to schema creation
| * Moving add_column_options! up to SchemaCreationjeran2013-06-121-11/+0
| | | | | | | | | | | | | | | | removed two instances of add_column_options! from abstract_mysql_adapter reworked rename_column_sql to remove add_column_options from schema_statements changed to use new hash syntax.
* | Remove behavior that deals with a string as third argument of `add_index`, ↵kennyj2013-06-021-28/+14
| | | | | | | | | | | | because this was deprecated. Some testcases is failed, so I replaced nil to empty hash in add_reference.
* | Merge pull request #10556 from Empact/deprecate-schema-statements-distinctRafael Mendonça França2013-05-121-1/+2
| | | | | | | | | | | | Deprecate SchemaStatements#distinct, and make SchemaStatements#columns_for_distinct nodoc. Conflicts: activerecord/CHANGELOG.md
* | Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"Ben Woosley2013-05-101-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | The combination of a :uniq => true association and the #distinct call in #construct_limited_ids_condition combine to create invalid SQL, because we're explicitly selecting DISTINCT, and also sending #distinct on to AREL, via the relation#distinct_value. Rather than build a select distinct clause in #construct_limited_ids_condition, I set #distinct! and pass just the columns into the select statement. This requires introducing a #columns_for_distinct method to return the select columns but not the statement itself.
* | Refactor index algorithm lookup so that it only builds the available options ↵Carlos Antonio da Silva2013-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | once This way the available options are only built for actually fetching the algorithm in case the option is given. The options are going to be necessary a second time only in case the option is given but does not exist, which is supposed to be due to a typo or something like that, so no problem.
* | Make docs a little bit more consistent with colons [ci skip]Carlos Antonio da Silva2013-03-301-9/+9
| |
* | Fix code examples indent in new index options docs [ci skip]Carlos Antonio da Silva2013-03-301-3/+3
| |
* | Use new hash style in doc examples [ci skip]Carlos Antonio da Silva2013-03-301-2/+2
|/
* Add support for FULLTEXT and SPATIAL indexes using the :type flag for MySQL.Ken Mazaika2013-03-271-1/+14
|
* Merge pull request #9928 from vipulnsward/fix_rename_auto_increment_mysqlRafael Mendonça França2013-03-261-0/+3
|\ | | | | respect auto_increment in rename_column for mysql
| * respect auto_increment in rename_column for mysqlVipul A M2013-03-271-0/+3
| |
* | Checks :algorithm argument for valid valuesDan McClain2013-03-261-1/+7
| |
* | Adds support for concurrent indexing in PostgreSQL adapterDan McClain2013-03-251-2/+5
|/ | | | | | | | Adds support for algorithm option in MySQL indexes Moves USING and algorithm options upstream The syntax is still specific to the Adapter, so the actual executed string happens in the corresponding adapter
* Custom index type support with :using.doabit2013-03-241-2/+9
|
* add uuid primary key supportAaron Patterson2013-03-221-1/+1
|
* push alter table add column sql in to the schema modification visitorAaron Patterson2013-03-221-3/+7
|
* push SQL generation inside the schema creation objectAaron Patterson2013-03-221-8/+4
|
* mostly decouple TableDefinition from the database connectionAaron Patterson2013-03-221-1/+1
|
* remove to_sql from TableDefinitionAaron Patterson2013-03-221-1/+1
|
* clean up pk delclaration in `create_table`Aaron Patterson2013-03-141-1/+8
|
* Fix typo [ci skip]Carlos Antonio da Silva2013-03-111-1/+1
|
* promotes change_column_null to the migrations APIXavier Noria2013-03-111-0/+20
|
* quick pass over the RDoc of schema_statements.rb [ci skip]Xavier Noria2013-03-111-122/+190
|
* documents how to DROP DEFAULT [ci skip]Xavier Noria2013-03-111-3/+7
|
* Make sure options is a hashRafael Mendonça França2013-03-081-1/+3
|
* If an index can't be found by column, use the index name.Ezekiel Smithburg2013-03-071-0/+6
| | | | schema_statements uses the column name by default to construct the index name, and then raises an exception if it doesn't exist, even if the name option is specified, which causes #8858. this commit makes index_name_for_remove fall back to constructing the index name to remove based on the name option.
* `Connection#structure_dump` is no longer used. #9518Yves Senn2013-03-061-5/+0
| | | | | | | As of ccc6910c we use `mysqldump` to create the `structure.sql`. The old `#structure_dump` code is still in AR but never used. I removed all relevant parts from the code-base.
* Support PostgreSQL specific column types when using `change_table`.Yves Senn2013-02-281-4/+8
| | | | | | | | Closes #9480. We use `TableDefinition` for `#create_table` and `Table` for `#change_table`. The PostgreSQL sepcifc types were only defined on `TableDefinition` so I also added them to `Table`.
* Indent comment block by two spaces.Marc Schütz2013-02-211-4/+4
| | | | | As requested by @fxn https://github.com/schuetzm/rails/commit/743d15bba182df80d003d205690ead988970299c#commitcomment-2661417
* Add more documentation for create_join_table.Marc Schütz2013-02-201-0/+8
| | | | | Explain that it doesn't create indices by default and that it also has a block form.
* also rename indexes when a table or column is renamedYves Senn2013-02-201-0/+22
| | | | When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
* reserve index name chars for internal rails operationsYves Senn2013-02-201-3/+5
| | | | | | | | | | | Some adapter (SQLite3) need to perform renaming operations to support the rails DDL. These rename prefixes operate with prefixes. When an index name already uses up the full space provieded by `index_name_length` these internal operations will fail. This patch introduces `allowed_index_name_length` which respects the amount of characters used for internal operations. It will always be <= `index_name_length` and every adapter can define how many characters need to be reserved.
* Fix calling quote column name in interpolated stringCarlos Antonio da Silva2012-12-211-1/+1
|
* Differentiate between remove_column and remove_columns. Make remove_column ↵Marc-Andre Lafortune2012-12-211-6/+19
| | | | | | reversible. [#8267]
* Make drop_table reversible [#8267]Marc-Andre Lafortune2012-12-211-0/+4
|