#ifndef EEDB_USER_AUDIT_H
#define EEDB_USER_AUDIT_H

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

namespace eedb {

	namespace user_audit_ {

		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 User_id {
			struct _alias_t {
				static constexpr const char _literal[] = R"("user_id")";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T user_id;
						T &operator()() { return user_id; }
						const T &operator()() const { return user_id; }
					};
			};

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

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

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

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

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

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

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

	struct user_audit : sqlpp::table_t<user_audit,
				user_audit_::Id,
				user_audit_::User_id,
				user_audit_::Action_id,
				user_audit_::Data,
				user_audit_::When> {
		using _value_type = sqlpp::no_value_t;
		struct _alias_t {
			static constexpr const char _literal[] = R"("user_audit")";
			using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
			template<typename T>
				struct _member_t {
					T user_audit;
					T &operator()() { return user_audit; }
					const T &operator()() const { return user_audit; }
				};
		};
	};
}

#endif
