Add basic support for DEFAULT values

This commit adds basic support to set `DEFAULT` collumn attributes.
I tested this only with postgres. While gorm cannot use it properly (as the structs are filled with data by default), it can at least create the tables in the database correctly.

This maybe a starting point to add proper `DEFAULT` support to gorm.
Sorry, I am not native English speaker, so those kinds of typos could be a
lot...

But I am quite open to accept any criticism, pull requests ;)

I just fixed those typos, let me know if there are more, Thank you!


On Fri, Jul 25, 2014 at 3:44 PM, Chris Aumann <notifications@github.com>
wrote:

> In field.go:
>
> > @@ -57,6 +57,11 @@ func parseSqlTag(str string) (typ string, addational_typ string, size int) {
> >  		}
> >
> >  		addational_typ = m["NOT NULL"] + " " + m["UNIQUE"]
> > +
> > +		if len(m["DEFAULT"]) > 0 {
> > +			addational_typ = addational_typ + "DEFAULT " + m["DEFAULT"]
> > +		}
>
> Yes, there are a lot of typos in the original code (typ instad of type,
> etc). I adapted it the way it is to not mess with the other code.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jinzhu/gorm/pull/170/files#r15389377>.
>



-- 
Best regards

------------------------
Jinzhu
github.com/jinzhu