Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if the current adapter supports DDL transaction #447

Merged
merged 1 commit into from Feb 11, 2015

Conversation

laurocaetano
Copy link
Contributor

It is necessary to make it possible to add other adapters that doesn't
have this support. i.e MySQL -> http://dev.mysql.com/doc/refman/5.0/en/cannot-roll-back.html

cc/ @josevalim

Checks if the adapter supports ddl transaction.

"""
defcallback supports_ddl_transaction?
Copy link
Member

Choose a reason for hiding this comment

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

Let's also tag the return type as boolean:

 defcallback supports_ddl_transaction? :: boolean

It was necessary to make it possible to add other adapters that doesn't
have this feature. i.e MySQL ->
http://dev.mysql.com/doc/refman/5.0/en/cannot-roll-back.html

@doc false

def supports_ddl_transaction? do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@josevalim I just moved the supports_ddl_transaction? function to the Ecto.Adapters.Postgres module. The problem now is that we are defining the behaviour inside the Ecto.Adapter.Migrations module and it will warn us that it is not implemented. Shall we move this behaviour definition to another place?

Copy link
Member

Choose a reason for hiding this comment

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

No it is fine as is. :)

josevalim added a commit that referenced this pull request Feb 11, 2015
Check if the current adapter supports DDL transaction
@josevalim josevalim merged commit 0ed488e into elixir-ecto:master Feb 11, 2015
@josevalim
Copy link
Member

😻

@laurocaetano laurocaetano deleted the check-ddl-transactions branch February 11, 2015 18:06
@laurocaetano
Copy link
Contributor Author

Thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants