mirraj2 / EZDB

Java MySQL API
MIT License
12 stars 9 forks source link

Support better syntax for adding indices to tables #3

Open mirraj2 opened 5 years ago

mirraj2 commented 5 years ago

Right now the structure is

    return new Table("myTable")
        .idColumn()
        .column("timestamp", Instant.class)
        .column("userId", Long.class)
        .column("vendorId", Long.class)
        .column("amount", Money.class)
        .index("userId")
        .index("vendorId");

A better structure would be

    return new Table("myTable")
        .idColumn()
        .column("timestamp", Instant.class)
        .column("userId", Long.class).index()
        .column("vendorId", Long.class).index()
        .column("amount", Money.class);

I've had a bunch of bugs when removing a column, but forgetting to remove the index