mbarre / schemacrawler-additional-lints

Some additionnal lints for Schemacrawler
Other
12 stars 7 forks source link

[New Lint] : TimeStamp without TimeZone Columns #179

Closed bheemreddy181-zz closed 5 years ago

bheemreddy181-zz commented 5 years ago

This is something specific to Date Type Columns - I see that Postgres supports different Date types but it's is a pain for DBA when migrating data to different databases when they come across timestamp type column without timezone.

I would like to create a PR for this and keep this disabled -setting the flag to false, meanwhile, I would like to hear from you people whether this lint makes sense.

@adriens if it makes sense, can you label this with [enhancement]

adriens commented 5 years ago

Could you please detail on how you would proceeed ? Some sql bases use cases would help a lot, I'd like to be really sure to understand it.

My first feeling is that it's a very good idea, timezones can be a mess :+1:

What could be very cool would to

  1. Get a create table sql, get the full detailed DDL
  2. Put some datas thanks to a sql (dummy insert statements are easy to deal with instead of COPY)
  3. Make the select that you will use to develop lints, so hopefully I'll can help too :+1: and explain the algorithm
  4. Put a default criticity and think about a nicely understandable message for end users
adriens commented 5 years ago

Btw, why ot putting an avatar for yourself on GH ? :smile_cat:

bheemreddy181-zz commented 5 years ago

Typically my approach would be like find any column with Timestamp Type and Error out Saying - Timestamp without time zone (timestamp) is not a permitted data type. Use timestamp with time zone (timestamptz), Juts one additional util should be for this.

adriens commented 5 years ago

Hmmm, that becomes really interesting ! We'll have to take a look at how we get this metadata in schemacrawler.

bheemreddy181-zz commented 5 years ago

What do you mean by metadata? Can you please elaborate? below is the sample report post-implementation.

screen shot 2019-02-24 at 8 22 55 pm
adriens commented 5 years ago

You mean the lint has been implemented :question: :exclamation: :heavy_heart_exclamation: :heart_eyes:

bheemreddy181-zz commented 5 years ago

PR will be out Soon :-p

adriens commented 5 years ago

looks like you are crazy too bro' :laughing: :rocket:

mbarre commented 5 years ago

Thanks @bheemreddy181 for your contribution 👍

bheemreddy181-zz commented 5 years ago

When can I expect this to get released ?

adriens commented 5 years ago

@mbarre : if you are ok with this, I can release today ?