@@ -105,23 +105,17 @@ void flex_lua_setup_index(lua_State *lua_state, flex_table_t *table)
105105 // get include columns
106106 std::vector<std::string> include_columns;
107107 lua_getfield (lua_state, -1 , " include" );
108- if (get_database_version () >= 110000 ) {
109- if (lua_isstring (lua_state, -1 )) {
110- check_and_add_column (*table, &include_columns,
111- lua_tostring (lua_state, -1 ));
112- } else if (lua_istable (lua_state, -1 )) {
113- check_and_add_columns (*table, &include_columns, lua_state);
114- } else if (!lua_isnil (lua_state, -1 )) {
115- throw std::runtime_error{
116- " The 'include' field in an index definition must contain a "
117- " string or an array." };
118- }
119- index.set_include_columns (include_columns);
108+ if (lua_isstring (lua_state, -1 )) {
109+ check_and_add_column (*table, &include_columns,
110+ lua_tostring (lua_state, -1 ));
111+ } else if (lua_istable (lua_state, -1 )) {
112+ check_and_add_columns (*table, &include_columns, lua_state);
120113 } else if (!lua_isnil (lua_state, -1 )) {
121- throw fmt_error ( " Database version ({}) doesn't support "
122- " include columns in indexes. " ,
123- get_database_version ()) ;
114+ throw std::runtime_error{
115+ " The 'include' field in an index definition must contain a "
116+ " string or an array. " } ;
124117 }
118+ index.set_include_columns (include_columns);
125119 lua_pop (lua_state, 1 );
126120
127121 // get tablespace
0 commit comments