#ifndef EEDB_AUTH_TOKEN_H
#define EEDB_AUTH_TOKEN_H

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

namespace eedb {

	namespace auth_token_ {

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

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

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

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

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

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

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

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

	struct auth_token : sqlpp::table_t<auth_token,
				auth_token_::Id,
				auth_token_::Auth_info_id,
				auth_token_::Value,
				auth_token_::Expires> {
		using _value_type = sqlpp::no_value_t;
		struct _alias_t {
			static constexpr const char _literal[] = R"("auth_token")";
			using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
			template<typename T>
				struct _member_t {
					T auth_token;
					T &operator()() { return auth_token; }
					const T &operator()() const { return auth_token; }
				};
		};
	};
}

#endif
