##// END OF EJS Templates
database: dropped CheckConstraint for auto-increment field for mysql/mariadb compatability....
marcink -
r3486:118155b6 default
parent child Browse files
Show More
@@ -680,7 +680,7 b' class Repository(Base, BaseModel):'
680 class Group(Base, BaseModel):
680 class Group(Base, BaseModel):
681 __tablename__ = 'groups'
681 __tablename__ = 'groups'
682 __table_args__ = (UniqueConstraint('group_name', 'group_parent_id'),
682 __table_args__ = (UniqueConstraint('group_name', 'group_parent_id'),
683 CheckConstraint('group_id != group_parent_id'), {'extend_existing':True},)
683 {'extend_existing':True},)
684 __mapper_args__ = {'order_by':'group_name'}
684 __mapper_args__ = {'order_by':'group_name'}
685
685
686 group_id = Column("group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
686 group_id = Column("group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -699,7 +699,6 b' class RepoGroup(Base, BaseModel):'
699 __tablename__ = 'groups'
699 __tablename__ = 'groups'
700 __table_args__ = (
700 __table_args__ = (
701 UniqueConstraint('group_name', 'group_parent_id'),
701 UniqueConstraint('group_name', 'group_parent_id'),
702 CheckConstraint('group_id != group_parent_id'),
703 {'extend_existing': True, 'mysql_engine':'InnoDB',
702 {'extend_existing': True, 'mysql_engine':'InnoDB',
704 'mysql_charset': 'utf8'},
703 'mysql_charset': 'utf8'},
705 )
704 )
@@ -513,7 +513,6 b' class RepoGroup(Base, BaseModel):'
513 __tablename__ = 'groups'
513 __tablename__ = 'groups'
514 __table_args__ = (
514 __table_args__ = (
515 UniqueConstraint('group_name', 'group_parent_id'),
515 UniqueConstraint('group_name', 'group_parent_id'),
516 CheckConstraint('group_id != group_parent_id'),
517 {'extend_existing': True, 'mysql_engine': 'InnoDB',
516 {'extend_existing': True, 'mysql_engine': 'InnoDB',
518 'mysql_charset': 'utf8'},
517 'mysql_charset': 'utf8'},
519 )
518 )
@@ -526,7 +526,6 b' class RepoGroup(Base, BaseModel):'
526 __tablename__ = 'groups'
526 __tablename__ = 'groups'
527 __table_args__ = (
527 __table_args__ = (
528 UniqueConstraint('group_name', 'group_parent_id'),
528 UniqueConstraint('group_name', 'group_parent_id'),
529 CheckConstraint('group_id != group_parent_id'),
530 {'extend_existing': True, 'mysql_engine': 'InnoDB',
529 {'extend_existing': True, 'mysql_engine': 'InnoDB',
531 'mysql_charset': 'utf8'},
530 'mysql_charset': 'utf8'},
532 )
531 )
@@ -543,7 +543,6 b' class RepoGroup(Base, BaseModel):'
543 __tablename__ = 'groups'
543 __tablename__ = 'groups'
544 __table_args__ = (
544 __table_args__ = (
545 UniqueConstraint('group_name', 'group_parent_id'),
545 UniqueConstraint('group_name', 'group_parent_id'),
546 CheckConstraint('group_id != group_parent_id'),
547 {'extend_existing': True, 'mysql_engine': 'InnoDB',
546 {'extend_existing': True, 'mysql_engine': 'InnoDB',
548 'mysql_charset': 'utf8'},
547 'mysql_charset': 'utf8'},
549 )
548 )
@@ -626,7 +626,6 b' class RepoGroup(Base, BaseModel):'
626 __tablename__ = 'groups'
626 __tablename__ = 'groups'
627 __table_args__ = (
627 __table_args__ = (
628 UniqueConstraint('group_name', 'group_parent_id'),
628 UniqueConstraint('group_name', 'group_parent_id'),
629 CheckConstraint('group_id != group_parent_id'),
630 {'extend_existing': True, 'mysql_engine': 'InnoDB',
629 {'extend_existing': True, 'mysql_engine': 'InnoDB',
631 'mysql_charset': 'utf8'},
630 'mysql_charset': 'utf8'},
632 )
631 )
@@ -597,7 +597,6 b' class RepoGroup(Base, BaseModel):'
597 __tablename__ = 'groups'
597 __tablename__ = 'groups'
598 __table_args__ = (
598 __table_args__ = (
599 UniqueConstraint('group_name', 'group_parent_id'),
599 UniqueConstraint('group_name', 'group_parent_id'),
600 CheckConstraint('group_id != group_parent_id'),
601 {'extend_existing': True, 'mysql_engine': 'InnoDB',
600 {'extend_existing': True, 'mysql_engine': 'InnoDB',
602 'mysql_charset': 'utf8'},
601 'mysql_charset': 'utf8'},
603 )
602 )
@@ -599,7 +599,6 b' class RepoGroup(Base, BaseModel):'
599 __tablename__ = 'groups'
599 __tablename__ = 'groups'
600 __table_args__ = (
600 __table_args__ = (
601 UniqueConstraint('group_name', 'group_parent_id'),
601 UniqueConstraint('group_name', 'group_parent_id'),
602 CheckConstraint('group_id != group_parent_id'),
603 {'extend_existing': True, 'mysql_engine': 'InnoDB',
602 {'extend_existing': True, 'mysql_engine': 'InnoDB',
604 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
603 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
605 )
604 )
@@ -622,7 +622,6 b' class RepoGroup(Base, BaseModel):'
622 __tablename__ = 'groups'
622 __tablename__ = 'groups'
623 __table_args__ = (
623 __table_args__ = (
624 UniqueConstraint('group_name', 'group_parent_id'),
624 UniqueConstraint('group_name', 'group_parent_id'),
625 CheckConstraint('group_id != group_parent_id'),
626 {'extend_existing': True, 'mysql_engine': 'InnoDB',
625 {'extend_existing': True, 'mysql_engine': 'InnoDB',
627 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
626 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
628 )
627 )
@@ -621,7 +621,6 b' class RepoGroup(Base, BaseModel):'
621 __tablename__ = 'groups'
621 __tablename__ = 'groups'
622 __table_args__ = (
622 __table_args__ = (
623 UniqueConstraint('group_name', 'group_parent_id'),
623 UniqueConstraint('group_name', 'group_parent_id'),
624 CheckConstraint('group_id != group_parent_id'),
625 {'extend_existing': True, 'mysql_engine': 'InnoDB',
624 {'extend_existing': True, 'mysql_engine': 'InnoDB',
626 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
625 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
627 )
626 )
@@ -639,7 +639,6 b' class RepoGroup(Base, BaseModel):'
639 __tablename__ = 'groups'
639 __tablename__ = 'groups'
640 __table_args__ = (
640 __table_args__ = (
641 UniqueConstraint('group_name', 'group_parent_id'),
641 UniqueConstraint('group_name', 'group_parent_id'),
642 CheckConstraint('group_id != group_parent_id'),
643 {'extend_existing': True, 'mysql_engine': 'InnoDB',
642 {'extend_existing': True, 'mysql_engine': 'InnoDB',
644 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
643 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
645 )
644 )
@@ -656,7 +656,6 b' class RepoGroup(Base, BaseModel):'
656 __tablename__ = 'groups'
656 __tablename__ = 'groups'
657 __table_args__ = (
657 __table_args__ = (
658 UniqueConstraint('group_name', 'group_parent_id'),
658 UniqueConstraint('group_name', 'group_parent_id'),
659 CheckConstraint('group_id != group_parent_id'),
660 {'extend_existing': True, 'mysql_engine': 'InnoDB',
659 {'extend_existing': True, 'mysql_engine': 'InnoDB',
661 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
660 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
662 )
661 )
@@ -672,7 +672,6 b' class RepoGroup(Base, BaseModel):'
672 __tablename__ = 'groups'
672 __tablename__ = 'groups'
673 __table_args__ = (
673 __table_args__ = (
674 UniqueConstraint('group_name', 'group_parent_id'),
674 UniqueConstraint('group_name', 'group_parent_id'),
675 CheckConstraint('group_id != group_parent_id'),
676 {'extend_existing': True, 'mysql_engine': 'InnoDB',
675 {'extend_existing': True, 'mysql_engine': 'InnoDB',
677 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
676 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
678 )
677 )
@@ -675,7 +675,6 b' class RepoGroup(Base, BaseModel):'
675 __tablename__ = 'groups'
675 __tablename__ = 'groups'
676 __table_args__ = (
676 __table_args__ = (
677 UniqueConstraint('group_name', 'group_parent_id'),
677 UniqueConstraint('group_name', 'group_parent_id'),
678 CheckConstraint('group_id != group_parent_id'),
679 {'extend_existing': True, 'mysql_engine': 'InnoDB',
678 {'extend_existing': True, 'mysql_engine': 'InnoDB',
680 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
679 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
681 )
680 )
@@ -679,7 +679,6 b' class RepoGroup(Base, BaseModel):'
679 __tablename__ = 'groups'
679 __tablename__ = 'groups'
680 __table_args__ = (
680 __table_args__ = (
681 UniqueConstraint('group_name', 'group_parent_id'),
681 UniqueConstraint('group_name', 'group_parent_id'),
682 CheckConstraint('group_id != group_parent_id'),
683 {'extend_existing': True, 'mysql_engine': 'InnoDB',
682 {'extend_existing': True, 'mysql_engine': 'InnoDB',
684 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
683 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
685 )
684 )
@@ -679,7 +679,6 b' class RepoGroup(Base, BaseModel):'
679 __tablename__ = 'groups'
679 __tablename__ = 'groups'
680 __table_args__ = (
680 __table_args__ = (
681 UniqueConstraint('group_name', 'group_parent_id'),
681 UniqueConstraint('group_name', 'group_parent_id'),
682 CheckConstraint('group_id != group_parent_id'),
683 {'extend_existing': True, 'mysql_engine': 'InnoDB',
682 {'extend_existing': True, 'mysql_engine': 'InnoDB',
684 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
683 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
685 )
684 )
@@ -707,7 +707,6 b' class RepoGroup(Base, BaseModel):'
707 __tablename__ = 'groups'
707 __tablename__ = 'groups'
708 __table_args__ = (
708 __table_args__ = (
709 UniqueConstraint('group_name', 'group_parent_id'),
709 UniqueConstraint('group_name', 'group_parent_id'),
710 CheckConstraint('group_id != group_parent_id'),
711 {'extend_existing': True, 'mysql_engine': 'InnoDB',
710 {'extend_existing': True, 'mysql_engine': 'InnoDB',
712 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
711 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
713 )
712 )
@@ -717,7 +717,6 b' class RepoGroup(Base, BaseModel):'
717 __tablename__ = 'groups'
717 __tablename__ = 'groups'
718 __table_args__ = (
718 __table_args__ = (
719 UniqueConstraint('group_name', 'group_parent_id'),
719 UniqueConstraint('group_name', 'group_parent_id'),
720 CheckConstraint('group_id != group_parent_id'),
721 {'extend_existing': True, 'mysql_engine': 'InnoDB',
720 {'extend_existing': True, 'mysql_engine': 'InnoDB',
722 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
721 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
723 )
722 )
@@ -760,7 +760,6 b' class RepoGroup(Base, BaseModel):'
760 __tablename__ = 'groups'
760 __tablename__ = 'groups'
761 __table_args__ = (
761 __table_args__ = (
762 UniqueConstraint('group_name', 'group_parent_id'),
762 UniqueConstraint('group_name', 'group_parent_id'),
763 CheckConstraint('group_id != group_parent_id'),
764 {'extend_existing': True, 'mysql_engine': 'InnoDB',
763 {'extend_existing': True, 'mysql_engine': 'InnoDB',
765 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
764 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
766 )
765 )
@@ -758,7 +758,6 b' class RepoGroup(Base, BaseModel):'
758 __tablename__ = 'groups'
758 __tablename__ = 'groups'
759 __table_args__ = (
759 __table_args__ = (
760 UniqueConstraint('group_name', 'group_parent_id'),
760 UniqueConstraint('group_name', 'group_parent_id'),
761 CheckConstraint('group_id != group_parent_id'),
762 {'extend_existing': True, 'mysql_engine': 'InnoDB',
761 {'extend_existing': True, 'mysql_engine': 'InnoDB',
763 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
762 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
764 )
763 )
@@ -759,7 +759,6 b' class RepoGroup(Base, BaseModel):'
759 __tablename__ = 'groups'
759 __tablename__ = 'groups'
760 __table_args__ = (
760 __table_args__ = (
761 UniqueConstraint('group_name', 'group_parent_id'),
761 UniqueConstraint('group_name', 'group_parent_id'),
762 CheckConstraint('group_id != group_parent_id'),
763 {'extend_existing': True, 'mysql_engine': 'InnoDB',
762 {'extend_existing': True, 'mysql_engine': 'InnoDB',
764 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
763 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
765 )
764 )
@@ -759,7 +759,6 b' class RepoGroup(Base, BaseModel):'
759 __tablename__ = 'groups'
759 __tablename__ = 'groups'
760 __table_args__ = (
760 __table_args__ = (
761 UniqueConstraint('group_name', 'group_parent_id'),
761 UniqueConstraint('group_name', 'group_parent_id'),
762 CheckConstraint('group_id != group_parent_id'),
763 {'extend_existing': True, 'mysql_engine': 'InnoDB',
762 {'extend_existing': True, 'mysql_engine': 'InnoDB',
764 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
763 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
765 )
764 )
@@ -765,7 +765,6 b' class RepoGroup(Base, BaseModel):'
765 __tablename__ = 'groups'
765 __tablename__ = 'groups'
766 __table_args__ = (
766 __table_args__ = (
767 UniqueConstraint('group_name', 'group_parent_id'),
767 UniqueConstraint('group_name', 'group_parent_id'),
768 CheckConstraint('group_id != group_parent_id'),
769 {'extend_existing': True, 'mysql_engine': 'InnoDB',
768 {'extend_existing': True, 'mysql_engine': 'InnoDB',
770 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
769 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
771 )
770 )
@@ -887,7 +887,6 b' class RepoGroup(Base, BaseModel):'
887 __tablename__ = 'groups'
887 __tablename__ = 'groups'
888 __table_args__ = (
888 __table_args__ = (
889 UniqueConstraint('group_name', 'group_parent_id'),
889 UniqueConstraint('group_name', 'group_parent_id'),
890 CheckConstraint('group_id != group_parent_id'),
891 {'extend_existing': True, 'mysql_engine': 'InnoDB',
890 {'extend_existing': True, 'mysql_engine': 'InnoDB',
892 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
891 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
893 )
892 )
@@ -912,7 +912,6 b' class RepoGroup(Base, BaseModel):'
912 __tablename__ = 'groups'
912 __tablename__ = 'groups'
913 __table_args__ = (
913 __table_args__ = (
914 UniqueConstraint('group_name', 'group_parent_id'),
914 UniqueConstraint('group_name', 'group_parent_id'),
915 CheckConstraint('group_id != group_parent_id'),
916 {'extend_existing': True, 'mysql_engine': 'InnoDB',
915 {'extend_existing': True, 'mysql_engine': 'InnoDB',
917 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
916 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
918 )
917 )
@@ -2295,7 +2295,6 b' class RepoGroup(Base, BaseModel):'
2295 __tablename__ = 'groups'
2295 __tablename__ = 'groups'
2296 __table_args__ = (
2296 __table_args__ = (
2297 UniqueConstraint('group_name', 'group_parent_id'),
2297 UniqueConstraint('group_name', 'group_parent_id'),
2298 CheckConstraint('group_id != group_parent_id'),
2299 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2298 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2300 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2299 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2301 )
2300 )
@@ -2361,7 +2361,6 b' class RepoGroup(Base, BaseModel):'
2361 __tablename__ = 'groups'
2361 __tablename__ = 'groups'
2362 __table_args__ = (
2362 __table_args__ = (
2363 UniqueConstraint('group_name', 'group_parent_id'),
2363 UniqueConstraint('group_name', 'group_parent_id'),
2364 CheckConstraint('group_id != group_parent_id'),
2365 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2364 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2366 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2365 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2367 )
2366 )
@@ -2436,7 +2436,6 b' class RepoGroup(Base, BaseModel):'
2436 __tablename__ = 'groups'
2436 __tablename__ = 'groups'
2437 __table_args__ = (
2437 __table_args__ = (
2438 UniqueConstraint('group_name', 'group_parent_id'),
2438 UniqueConstraint('group_name', 'group_parent_id'),
2439 CheckConstraint('group_id != group_parent_id'),
2440 base_table_args,
2439 base_table_args,
2441 )
2440 )
2442 __mapper_args__ = {'order_by': 'group_name'}
2441 __mapper_args__ = {'order_by': 'group_name'}
@@ -2459,7 +2459,6 b' class RepoGroup(Base, BaseModel):'
2459 __tablename__ = 'groups'
2459 __tablename__ = 'groups'
2460 __table_args__ = (
2460 __table_args__ = (
2461 UniqueConstraint('group_name', 'group_parent_id'),
2461 UniqueConstraint('group_name', 'group_parent_id'),
2462 CheckConstraint('group_id != group_parent_id'),
2463 base_table_args,
2462 base_table_args,
2464 )
2463 )
2465 __mapper_args__ = {'order_by': 'group_name'}
2464 __mapper_args__ = {'order_by': 'group_name'}
@@ -2459,7 +2459,6 b' class RepoGroup(Base, BaseModel):'
2459 __tablename__ = 'groups'
2459 __tablename__ = 'groups'
2460 __table_args__ = (
2460 __table_args__ = (
2461 UniqueConstraint('group_name', 'group_parent_id'),
2461 UniqueConstraint('group_name', 'group_parent_id'),
2462 CheckConstraint('group_id != group_parent_id'),
2463 base_table_args,
2462 base_table_args,
2464 )
2463 )
2465 __mapper_args__ = {'order_by': 'group_name'}
2464 __mapper_args__ = {'order_by': 'group_name'}
@@ -2007,7 +2007,6 b' class RepoGroup(Base, BaseModel):'
2007 __tablename__ = 'groups'
2007 __tablename__ = 'groups'
2008 __table_args__ = (
2008 __table_args__ = (
2009 UniqueConstraint('group_name', 'group_parent_id'),
2009 UniqueConstraint('group_name', 'group_parent_id'),
2010 CheckConstraint('group_id != group_parent_id'),
2011 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2010 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2012 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2011 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2013 )
2012 )
@@ -1999,7 +1999,6 b' class RepoGroup(Base, BaseModel):'
1999 __tablename__ = 'groups'
1999 __tablename__ = 'groups'
2000 __table_args__ = (
2000 __table_args__ = (
2001 UniqueConstraint('group_name', 'group_parent_id'),
2001 UniqueConstraint('group_name', 'group_parent_id'),
2002 CheckConstraint('group_id != group_parent_id'),
2003 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2002 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2004 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2003 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2005 )
2004 )
@@ -1998,7 +1998,6 b' class RepoGroup(Base, BaseModel):'
1998 __tablename__ = 'groups'
1998 __tablename__ = 'groups'
1999 __table_args__ = (
1999 __table_args__ = (
2000 UniqueConstraint('group_name', 'group_parent_id'),
2000 UniqueConstraint('group_name', 'group_parent_id'),
2001 CheckConstraint('group_id != group_parent_id'),
2002 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2001 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2003 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2002 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2004 )
2003 )
@@ -2000,7 +2000,6 b' class RepoGroup(Base, BaseModel):'
2000 __tablename__ = 'groups'
2000 __tablename__ = 'groups'
2001 __table_args__ = (
2001 __table_args__ = (
2002 UniqueConstraint('group_name', 'group_parent_id'),
2002 UniqueConstraint('group_name', 'group_parent_id'),
2003 CheckConstraint('group_id != group_parent_id'),
2004 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2003 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2005 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2004 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2006 )
2005 )
@@ -2000,7 +2000,6 b' class RepoGroup(Base, BaseModel):'
2000 __tablename__ = 'groups'
2000 __tablename__ = 'groups'
2001 __table_args__ = (
2001 __table_args__ = (
2002 UniqueConstraint('group_name', 'group_parent_id'),
2002 UniqueConstraint('group_name', 'group_parent_id'),
2003 CheckConstraint('group_id != group_parent_id'),
2004 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2003 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2005 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2004 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2006 )
2005 )
@@ -2043,7 +2043,6 b' class RepoGroup(Base, BaseModel):'
2043 __tablename__ = 'groups'
2043 __tablename__ = 'groups'
2044 __table_args__ = (
2044 __table_args__ = (
2045 UniqueConstraint('group_name', 'group_parent_id'),
2045 UniqueConstraint('group_name', 'group_parent_id'),
2046 CheckConstraint('group_id != group_parent_id'),
2047 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2046 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2048 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2047 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2049 )
2048 )
@@ -2044,7 +2044,6 b' class RepoGroup(Base, BaseModel):'
2044 __tablename__ = 'groups'
2044 __tablename__ = 'groups'
2045 __table_args__ = (
2045 __table_args__ = (
2046 UniqueConstraint('group_name', 'group_parent_id'),
2046 UniqueConstraint('group_name', 'group_parent_id'),
2047 CheckConstraint('group_id != group_parent_id'),
2048 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2047 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2049 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2048 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2050 )
2049 )
@@ -2231,7 +2231,6 b' class RepoGroup(Base, BaseModel):'
2231 __tablename__ = 'groups'
2231 __tablename__ = 'groups'
2232 __table_args__ = (
2232 __table_args__ = (
2233 UniqueConstraint('group_name', 'group_parent_id'),
2233 UniqueConstraint('group_name', 'group_parent_id'),
2234 CheckConstraint('group_id != group_parent_id'),
2235 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2234 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2236 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2235 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2237 )
2236 )
@@ -2460,7 +2460,6 b' class RepoGroup(Base, BaseModel):'
2460 __tablename__ = 'groups'
2460 __tablename__ = 'groups'
2461 __table_args__ = (
2461 __table_args__ = (
2462 UniqueConstraint('group_name', 'group_parent_id'),
2462 UniqueConstraint('group_name', 'group_parent_id'),
2463 CheckConstraint('group_id != group_parent_id'),
2464 base_table_args,
2463 base_table_args,
2465 )
2464 )
2466 __mapper_args__ = {'order_by': 'group_name'}
2465 __mapper_args__ = {'order_by': 'group_name'}
@@ -2481,8 +2480,7 b' class RepoGroup(Base, BaseModel):'
2481 users_group_to_perm = relationship('UserGroupRepoGroupToPerm', cascade='all')
2480 users_group_to_perm = relationship('UserGroupRepoGroupToPerm', cascade='all')
2482 parent_group = relationship('RepoGroup', remote_side=group_id)
2481 parent_group = relationship('RepoGroup', remote_side=group_id)
2483 user = relationship('User')
2482 user = relationship('User')
2484 integrations = relationship('Integration',
2483 integrations = relationship('Integration', cascade="all, delete, delete-orphan")
2485 cascade="all, delete, delete-orphan")
2486
2484
2487 def __init__(self, group_name='', parent_group=None):
2485 def __init__(self, group_name='', parent_group=None):
2488 self.group_name = group_name
2486 self.group_name = group_name
@@ -2492,6 +2490,16 b' class RepoGroup(Base, BaseModel):'
2492 return u"<%s('id:%s:%s')>" % (
2490 return u"<%s('id:%s:%s')>" % (
2493 self.__class__.__name__, self.group_id, self.group_name)
2491 self.__class__.__name__, self.group_id, self.group_name)
2494
2492
2493 @validates('group_parent_id')
2494 def validate_group_parent_id(self, key, val):
2495 """
2496 Check cycle references for a parent group to self
2497 """
2498 if self.group_id and val:
2499 assert val != self.group_id
2500
2501 return val
2502
2495 @hybrid_property
2503 @hybrid_property
2496 def description_safe(self):
2504 def description_safe(self):
2497 from rhodecode.lib import helpers as h
2505 from rhodecode.lib import helpers as h
General Comments 0
You need to be logged in to leave comments. Login now