> On May 9, 2017, 3:34 p.m., Na Li wrote: > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.derby.sql > > Lines 26 (patched) > > <https://reviews.apache.org/r/58808/diff/1/?file=1702015#file1702015line26> > > > > Can you add comment that this table should have only one row?
I have taken a different approach. This comment may not be valid now. > On May 9, 2017, 3:34 p.m., Na Li wrote: > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.derby.sql > > Lines 30 (patched) > > <https://reviews.apache.org/r/58808/diff/1/?file=1702015#file1702015line30> > > > > This link may be useful for you to limit the table with only one row. > > ENUM and SET columns provide an efficient way to define columns that can > > contain only a given set of values > > https://dev.mysql.com/doc/refman/5.7/en/constraint-enum.html > > > > CREATE TABLE SENTRY_LAST_NOTIFICATION_ID ( > > `id` enum('1') NOT NULL, > > NOTIFICATION_ID BIGINT NOT NULL, > > PRIMARY KEY (`id`) > > ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='The ENUM(''1'') > > construct as primary key is used to prevent that more than one row can be > > entered to the table'; I have this approach but had issues comming up with similar approach for other databases as well. I have taken a different approach. This comment may not be valid now. - kalyan kumar ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58808/#review173635 ----------------------------------------------------------- On May 9, 2017, 11:15 p.m., kalyan kumar kalvagadda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58808/ > ----------------------------------------------------------- > > (Updated May 9, 2017, 11:15 p.m.) > > > Review request for sentry, Alexander Kolbasov, Hao Hao, Na Li, Sergio Pena, > Vamsee Yarlagadda, and Vadim Spector. > > > Bugs: SENTRY-1726 > https://issues.apache.org/jira/browse/SENTRY-1726 > > > Repository: sentry > > > Description > ------- > > 1. Created new table to store the last notification id > 2. Table will store the notification id's of all the notifications processed > by sentry server. > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.derby.sql > ba70715 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.mysql.sql > 879e732 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.oracle.sql > e83ab83 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.postgres.sql > c28099b > sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql > 841dcaa > > sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.8.0.sql > 223835e > > sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.8.0.sql > 006d57b > > sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.8.0.sql > 20921ea > > sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.8.0.sql > 489ad66 > > sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql > ec50912 > > > Diff: https://reviews.apache.org/r/58808/diff/2/ > > > Testing > ------- > > Tested with the databases that sentry supports. > > > Thanks, > > kalyan kumar kalvagadda > >
