Contrib T4 some fixes #338

Merged
merged 18 commits into from Jan 30, 2013

Projects

None yet

2 participants

@spaccabit

Soame t4 fixes

spaccabit added some commits Nov 19, 2012
@spaccabit spaccabit [Contrib][T4][SQL Server] Fix ForeignKey order definition b6cb12d
@spaccabit spaccabit [Contrib][T4] Add missing float datatype mapping 3af22b5
@spaccabit spaccabit [Contrib][T4][SQL Server] Fix retrive index definition when table dei…
…nfinition has more index

When you have table with this schema
CREATE TABLE [Test Issue](
[ID_Primary] [int] IDENTITY(1,1) NOT NULL,
[Description] [nvarchar](50) NULL,
[ID_Nation] [int] NOT NULL,
CONSTRAINT [PK_Test Issue] PRIMARY KEY CLUSTERED
(
[ID_Primary] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [Test Issue] ADD  CONSTRAINT [DF_Test Issue_ID_Nation]
DEFAULT ((0)) FOR [ID_Nation]
GO

the T4 template generated the following incorrect migration:

[Migration(20121120061957)]
public class CreateInitialDB : Migration
{
public override void Up()
{
//For Test Issue
Create.Table("Test Issue").InSchema("dbo")

.WithColumn("ID_Primary").AsInt32().PrimaryKey().Identity().NotNullable()
.WithColumn("Description").AsString().Nullable()
.WithColumn("ID_Nation").AsInt32().NotNullable();

Create.Index("IX_Nation").OnTable("Test Issue").InSchema("dbo")
.OnColumn("ID_Nation").Ascending()
.OnColumn("ID_Primary").Ascending();
}

public override void Down()
{

Delete.Index("IX_Nation");

Delete.Table("Test Issue");
}
}
b5bd428
@spaccabit spaccabit [Contrib][T4][Tests] Ignore generated class ffef436
@spaccabit spaccabit [Contrib][T4][Tests] Fix project reference 9cec840
@spaccabit spaccabit [Contrib][T4] Change type of Column.PropertyType from string to Syste…
…m.Data.DbType?
8fac7f8
@spaccabit spaccabit [Contrib][T4] Column CustomType e5b0b6a
@spaccabit spaccabit [Contrib][T4][SQl Server] Missing DefaultValue 546536f
@spaccabit spaccabit [Contrib][T4] Add DataReader Get<T> extension method ed40874
@spaccabit spaccabit [Contrib][T4][SQL Server] Fix retrive column size and precision 9d836bc
@spaccabit spaccabit [Contrib][T4] Fix T4 template drop ForeignKey and Index 571ef31
@spaccabit spaccabit [Contrib][T4] Fix detection of Guid DefaultValue 8defc3c
@spaccabit spaccabit [Contrib][T4] Fix detection of Byte DefaultValue 759debf
@spaccabit spaccabit [Contrib][T4] Remove unnecessary Bracket from DefaultValue 77a0fcd
@spaccabit spaccabit Merge branch 'master' of https://github.com/schambers/fluentmigrator 618660c
@spaccabit spaccabit [Contrib][T4] Add support at ForeignKey UpdateRule and DeleteRule 4fb41b3
@spaccabit spaccabit [Contrib][T4][SQL Server] ForeignKey UpdateRule and DeleteRule 23e14f8
@spaccabit spaccabit [Contrib][T4] Fix Binary(MAX) beb24f1
@daniellee
Collaborator

Thanks for the Pull Request and sorry about the delay. I'll test this out during the week.

@daniellee
Collaborator

Great work, this is starting to be usable! Especially when running against Sql Server 2008 or 2012.

@daniellee daniellee merged commit 0b66351 into schambers:master Jan 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment