Creating Computed Columns

899 views
Skip to first unread message

Tyrel Van Niekerk

unread,
Jul 16, 2012, 5:16:50 PM7/16/12
to fluentmigrato...@googlegroups.com
Is it possible to create a computed column via the fluent syntax or do you have to revert to SQL?

Sean Chambers

unread,
Jul 16, 2012, 5:23:12 PM7/16/12
to fluentmigrato...@googlegroups.com, fluentmigrato...@googlegroups.com
I'm pretty sure you need to rely on execute.sql for those. 

The API is setup to be agnostic as far as db vendor is concerned. 

Sean

Sent from my iPhone

On Jul 16, 2012, at 5:16 PM, Tyrel Van Niekerk <tyrelva...@gmail.com> wrote:

Is it possible to create a computed column via the fluent syntax or do you have to revert to SQL?

--
You received this message because you are subscribed to the Google Groups "FluentMigrator Google Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fluentmigrator-google-group/-/SE8kvoI7H8gJ.
To post to this group, send email to fluentmigrato...@googlegroups.com.
To unsubscribe from this group, send email to fluentmigrator-goog...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluentmigrator-google-group?hl=en.

Tyrel Van Niekerk

unread,
Jul 17, 2012, 6:36:23 AM7/17/12
to fluentmigrato...@googlegroups.com
Thanks, what I was expecting, just had to be sure.

On Monday, July 16, 2012 4:23:12 PM UTC-5, Sean Chambers wrote:
I'm pretty sure you need to rely on execute.sql for those. 

The API is setup to be agnostic as far as db vendor is concerned. 

Sean

Sent from my iPhone

On Jul 16, 2012, at 5:16 PM, Tyrel Van Niekerk <tyrelva...@gmail.com> wrote:

Is it possible to create a computed column via the fluent syntax or do you have to revert to SQL?

--
You received this message because you are subscribed to the Google Groups "FluentMigrator Google Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fluentmigrator-google-group/-/SE8kvoI7H8gJ.
To post to this group, send email to fluentmigrator-google-group@googlegroups.com.
To unsubscribe from this group, send email to fluentmigrator-google-group+unsub...@googlegroups.com.

Euclides Catunda

unread,
Nov 30, 2017, 8:22:56 AM11/30/17
to FluentMigrator Google Group
Try this:

Alter.Table(<tableName>).InSchema(<schemaName>).AddColumn("<CalculedFieldName>").AsCustom(" as (<dbo.MyFunctionName>(<MyParam>))").Nullable();
Reply all
Reply to author
Forward
0 new messages