#ifndef EEDB_GROUP_H
#define EEDB_GROUP_H

#include <sqlpp11/table.h>
#include <sqlpp11/char_sequence.h>
#include <sqlpp11/column_types.h>

namespace eedb {

	namespace group_ {

		struct Gid {
			struct _alias_t {
				static constexpr const char _literal[] = R"("gid")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T gid;
						T &operator()() { return gid; }
						const T &operator()() const { return gid; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::integer, sqlpp::tag::must_not_insert, sqlpp::tag::must_not_update>;
		};

		struct Name {
			struct _alias_t {
				static constexpr const char _literal[] = R"("name")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T name;
						T &operator()() { return name; }
						const T &operator()() const { return name; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::text, sqlpp::tag::require_insert>;
		};

		struct Description {
			struct _alias_t {
				static constexpr const char _literal[] = R"("description")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T description;
						T &operator()() { return description; }
						const T &operator()() const { return description; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::text, sqlpp::tag::can_be_null>;
		};

		struct Created {
			struct _alias_t {
				static constexpr const char _literal[] = R"("created")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T created;
						T &operator()() { return created; }
						const T &operator()() const { return created; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::time_point>;
		};

		struct Updated {
			struct _alias_t {
				static constexpr const char _literal[] = R"("updated")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T updated;
						T &operator()() { return updated; }
						const T &operator()() const { return updated; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::time_point, sqlpp::tag::can_be_null>;
		};
	}

	struct group : sqlpp::table_t<group,
				group_::Gid,
				group_::Name,
				group_::Description,
				group_::Created,
				group_::Updated> {
		using _value_type = sqlpp::no_value_t;
		struct _alias_t {
			static constexpr const char _literal[] = R"("group")";
			using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
			template<typename T>
				struct _member_t {
					T group;
					T &operator()() { return group; }
					const T &operator()() const { return group; }
				};
		};
	};
}

#endif
