Skip to content

Comments

Specify mysql engine on creation#12172

Closed
Intrepidd wants to merge 1 commit intorails:masterfrom
Intrepidd:specify-mysql-engine-on-creation
Closed

Specify mysql engine on creation#12172
Intrepidd wants to merge 1 commit intorails:masterfrom
Intrepidd:specify-mysql-engine-on-creation

Conversation

@Intrepidd
Copy link
Contributor

I merged #8242 so it can be applied cleanly

I didn't squash because I don't want @kenmazaika 's contribution to be lost, and he does not seem to want to merge this himself.

Thanks

@pftg
Copy link
Contributor

pftg commented Sep 9, 2013

Need to add changelog

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this descriptive variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a relic from the original PR, I'll remove that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the code comes from the current version of rails and is not an adding of this PR.

@Intrepidd
Copy link
Contributor Author

@rafaelfranca I've made some changes, can you have a look? Cheers.

@Intrepidd
Copy link
Contributor Author

Hey guys, I just rebased this branch and added a README.md entry, what can I do to wrap this up ?

@matthewd
Copy link
Member

  • The changelog doesn't seem to match the change.
  • I'm not sure we want to include 'ENGINE=InnoDB' on every table definition... maybe only if it differs from the default?
  • You haven't removed the with_indifferent_access call you said you were going to.

@Intrepidd
Copy link
Contributor Author

What's wrong with the changelog ? English is not my first language so maybe I wrote something wrong, I could rephrase like :

"Allow to pass an engine option to the create_table method to be able to choose any MySQL Engine"

Ok for the two other points, I'll try to update the pull request tonight or tomorrow.

@matthewd
Copy link
Member

It's just Wrong: it describes a syntax engine: 'InnoDB', whereas the code implements options: 'ENGINE=InnoDB'.

@Intrepidd
Copy link
Contributor Author

Indeed, sorry for the confusion, this was not my work originally.

So what do you prefer ? Passing an :engine option or allowing to add any options with the :options option ?

@Intrepidd
Copy link
Contributor Author

BTW I'd go for the :engine way because it's easy to dump the engine but it would be a mess to dump all the updated options of the table.

@matthewd
Copy link
Member

Well, this goes back to @jeremy's concerns on #8242; should we be handling all the possible table options? What about PostgreSQL's equivalent construct?

IMO, a top-level :engine option gives a questionable amount of special significance to it... what if we implement options: { engine: 'InnoDB' } for now? That seems to leave the door open for us to blindly use the entire contents of the :options hash in future.

@Intrepidd
Copy link
Contributor Author

The problem with options: {engine: 'InnoDB'} is that at the moment, we can pass any MySQL option in the :options hash, for example, options: 'Engine=InnoDB, INSERT_METHOD = LAST

In order to be backward compatible, the best way would be to retrieve the non-default values of the table and dump them.

This is probably hard, since they may vary depending on the mysql version, etc :(

@kenmazaika
Copy link
Contributor

Thanks for picking up the work on this, @Intrepidd! :) Super appreciated.

@repinel
Copy link
Member

repinel commented Apr 21, 2015

Is the request still valid? @Intrepidd, are you working on it?

@Intrepidd
Copy link
Contributor Author

This PR is stale and I don't have the time to work on it at the moment. There were too many questions, help from a core team member would be really beneficial but I'm not sure if lots of people need this feature.

@kenmazaika
Copy link
Contributor

Hehe. Same thing happened to me with #8242, @Intrepidd

@kamipo
Copy link
Member

kamipo commented May 6, 2015

@repinel @Intrepidd @kenmazaika #17569 was merged, the PR contains the feature that ENGINE name specifying.

@rafaelfranca
Copy link
Member

Thank you for the pull request. It is now possible with the options parameter to create table. create_table :foo, options: "ENGINE=MyISAM"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants