Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

t4 template doesn't create proper copy of db #348

Closed
reharik opened this Issue · 3 comments

2 participants

@reharik

Hi,
Very possible I'm doing something wrong, but here's my situation.
I have an existing db that I would like to start using FM on. So I use the t4 template to create the initial db creation. Then I apply it to a blank test db and compare the schema and there are a lot of constraints in the orig, and none in the new. Below is an example of a table. Am I missing something? Not being a big db guy I don't even know if these diffs make much difference. Any thoughts would be appreciated.
Raif

CREATE TABLE [dbo].Appointment ON [PRIMARY]
GO

and here is the gen table

CREATE TABLE [dbo].Appointment ON [PRIMARY]
GO

@daniellee
Collaborator

FluentMigrator.T4 is still a work in progress and is not production ready yet. It should generate out the foreign keys but if you want to use it then you'll have to be prepared to patch it to get it to work for you. There is a pull request #338 that will improve it more but that hasn't been merged in yet.

For now, I would recommend generating the sql to create your database, saving it to a text file and executing it as your baseline migration. Look at the Execute Expression section at https://github.com/schambers/fluentmigrator/wiki/Fluent-Interface to see how to do this. Execute.EmbeddedScript is what you need for that.

@reharik

Hi, thanks for the info. Ordinarily I would be happy to figure out the solution and post a patch, but it just so happens I hate db stuff, and I don't really have any experience with t4 either. So I'm going to take the easy way out this time.

Thanks again, and I do enjoy using fluentmigrator.
Raif

@daniellee
Collaborator

FluentMigrator.T4 has improved a lot since this issue was logged. It needs some documentation and then it is ready to be used.

@daniellee daniellee closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.