1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-02-17 11:45:50 +00:00

Generate a table scheme with some valid username.

Have main prog print the new build time constant.
This commit is contained in:
King_DuckZ 2016-01-05 14:12:36 +00:00
parent c7b44f6368
commit 839b9dd49a
4 changed files with 30 additions and 23 deletions

View file

@ -9,6 +9,7 @@ include(Buildlibpqtypes)
option(DINDEXER_DEBUG_CFG_FILE "Enable to set the config file path to the build path" OFF)
option(DINDEXER_WITH_MEDIA_AUTODETECT "Enable code that tries to autodetect the media type and sets --type automatically" ON)
set(ACTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE STRING "Actions search path")
set(DB_OWNER_NAME "$ENV{USER}" CACHE STRING "Name that will be used as the DB owner name")
set(PROJECT_VERSION_BETA "1")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -Wall -Wextra -O3 -fomit-frame-pointer -Wno-missing-field-initializers")
@ -38,6 +39,10 @@ configure_file(
"${PROJECT_SOURCE_DIR}/src/${bare_name}Config.h.in"
"${PROJECT_BINARY_DIR}/${bare_name}Config.h"
)
configure_file(
"${PROJECT_SOURCE_DIR}/dindexer.sql.in"
"${PROJECT_BINARY_DIR}/dindexer.sql"
)
target_include_directories(${PROJECT_NAME} SYSTEM
INTERFACE ${Boost_INCLUDE_DIRS}

View file

@ -34,7 +34,7 @@ SET search_path = public, pg_catalog;
--
-- TOC entry 191 (class 1255 OID 31290)
-- Name: upcase_hash(); Type: FUNCTION; Schema: public; Owner: @USERNAME@
-- Name: upcase_hash(); Type: FUNCTION; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE FUNCTION upcase_hash() RETURNS trigger
@ -47,7 +47,7 @@ CREATE FUNCTION upcase_hash() RETURNS trigger
$$;
ALTER FUNCTION public.upcase_hash() OWNER TO @USERNAME@;
ALTER FUNCTION public.upcase_hash() OWNER TO @DB_OWNER_NAME@;
SET default_tablespace = '';
@ -55,7 +55,7 @@ SET default_with_oids = false;
--
-- TOC entry 175 (class 1259 OID 31281)
-- Name: files; Type: TABLE; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: files; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
CREATE TABLE files (
@ -76,12 +76,12 @@ CREATE TABLE files (
);
ALTER TABLE files OWNER TO @USERNAME@;
ALTER TABLE files OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2040 (class 0 OID 0)
-- Dependencies: 175
-- Name: CONSTRAINT chk_hash_0 ON files; Type: COMMENT; Schema: public; Owner: @USERNAME@
-- Name: CONSTRAINT chk_hash_0 ON files; Type: COMMENT; Schema: public; Owner: @DB_OWNER_NAME@
--
COMMENT ON CONSTRAINT chk_hash_0 ON files IS 'Make sure hash is 0 if unreadable or not valid are set.';
@ -89,7 +89,7 @@ COMMENT ON CONSTRAINT chk_hash_0 ON files IS 'Make sure hash is 0 if unreadable
--
-- TOC entry 174 (class 1259 OID 31279)
-- Name: files_id_seq; Type: SEQUENCE; Schema: public; Owner: @USERNAME@
-- Name: files_id_seq; Type: SEQUENCE; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE SEQUENCE files_id_seq
@ -100,12 +100,12 @@ CREATE SEQUENCE files_id_seq
CACHE 1;
ALTER TABLE files_id_seq OWNER TO @USERNAME@;
ALTER TABLE files_id_seq OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2041 (class 0 OID 0)
-- Dependencies: 174
-- Name: files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @USERNAME@
-- Name: files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER SEQUENCE files_id_seq OWNED BY files.id;
@ -113,7 +113,7 @@ ALTER SEQUENCE files_id_seq OWNED BY files.id;
--
-- TOC entry 177 (class 1259 OID 31411)
-- Name: sets; Type: TABLE; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: sets; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
CREATE TABLE sets (
@ -126,12 +126,12 @@ CREATE TABLE sets (
);
ALTER TABLE sets OWNER TO @USERNAME@;
ALTER TABLE sets OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2042 (class 0 OID 0)
-- Dependencies: 177
-- Name: COLUMN sets.type; Type: COMMENT; Schema: public; Owner: @USERNAME@
-- Name: COLUMN sets.type; Type: COMMENT; Schema: public; Owner: @DB_OWNER_NAME@
--
COMMENT ON COLUMN sets.type IS 'D = directory
@ -145,7 +145,7 @@ O = Other';
--
-- TOC entry 176 (class 1259 OID 31409)
-- Name: sets_id_seq; Type: SEQUENCE; Schema: public; Owner: @USERNAME@
-- Name: sets_id_seq; Type: SEQUENCE; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE SEQUENCE sets_id_seq
@ -156,12 +156,12 @@ CREATE SEQUENCE sets_id_seq
CACHE 1;
ALTER TABLE sets_id_seq OWNER TO @USERNAME@;
ALTER TABLE sets_id_seq OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2043 (class 0 OID 0)
-- Dependencies: 176
-- Name: sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @USERNAME@
-- Name: sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER SEQUENCE sets_id_seq OWNED BY sets.id;
@ -169,7 +169,7 @@ ALTER SEQUENCE sets_id_seq OWNED BY sets.id;
--
-- TOC entry 1904 (class 2604 OID 31284)
-- Name: id; Type: DEFAULT; Schema: public; Owner: @USERNAME@
-- Name: id; Type: DEFAULT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY files ALTER COLUMN id SET DEFAULT nextval('files_id_seq'::regclass);
@ -177,7 +177,7 @@ ALTER TABLE ONLY files ALTER COLUMN id SET DEFAULT nextval('files_id_seq'::regcl
--
-- TOC entry 1908 (class 2604 OID 31414)
-- Name: id; Type: DEFAULT; Schema: public; Owner: @USERNAME@
-- Name: id; Type: DEFAULT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY sets ALTER COLUMN id SET DEFAULT nextval('sets_id_seq'::regclass);
@ -185,7 +185,7 @@ ALTER TABLE ONLY sets ALTER COLUMN id SET DEFAULT nextval('sets_id_seq'::regclas
--
-- TOC entry 1916 (class 2606 OID 31289)
-- Name: pk_files_id; Type: CONSTRAINT; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: pk_files_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
ALTER TABLE ONLY files
@ -194,7 +194,7 @@ ALTER TABLE ONLY files
--
-- TOC entry 1920 (class 2606 OID 31420)
-- Name: pk_sets_id; Type: CONSTRAINT; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: pk_sets_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
ALTER TABLE ONLY sets
@ -203,7 +203,7 @@ ALTER TABLE ONLY sets
--
-- TOC entry 1918 (class 2606 OID 31294)
-- Name: uniq_item; Type: CONSTRAINT; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: uniq_item; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
ALTER TABLE ONLY files
@ -212,7 +212,7 @@ ALTER TABLE ONLY files
--
-- TOC entry 1913 (class 1259 OID 31426)
-- Name: fki_files_sets; Type: INDEX; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: fki_files_sets; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
CREATE INDEX fki_files_sets ON files USING btree (group_id);
@ -220,7 +220,7 @@ CREATE INDEX fki_files_sets ON files USING btree (group_id);
--
-- TOC entry 1914 (class 1259 OID 31292)
-- Name: idx_paths; Type: INDEX; Schema: public; Owner: @USERNAME@; Tablespace:
-- Name: idx_paths; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
--
CREATE INDEX idx_paths ON files USING btree (path);
@ -228,7 +228,7 @@ CREATE INDEX idx_paths ON files USING btree (path);
--
-- TOC entry 1922 (class 2620 OID 31291)
-- Name: triggerupcasehash; Type: TRIGGER; Schema: public; Owner: @USERNAME@
-- Name: triggerupcasehash; Type: TRIGGER; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE TRIGGER triggerupcasehash BEFORE INSERT OR UPDATE ON files FOR EACH ROW EXECUTE PROCEDURE upcase_hash();
@ -236,7 +236,7 @@ CREATE TRIGGER triggerupcasehash BEFORE INSERT OR UPDATE ON files FOR EACH ROW E
--
-- TOC entry 1921 (class 2606 OID 31421)
-- Name: fk_files_sets; Type: FK CONSTRAINT; Schema: public; Owner: @USERNAME@
-- Name: fk_files_sets; Type: FK CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY files

View file

@ -27,5 +27,6 @@
#define CONFIG_FILE_PATH "@DINDEXER_CONFIG_FILE@"
#define ACTIONS_SEARCH_PATH "@ACTIONS_PATH@"
#define ACTION_PREFIX "@bare_name@-"
#define DB_OWNER_NAME "@DB_OWNER_NAME@"
#endif

View file

@ -47,4 +47,5 @@ void print_builtin_feats() {
#else
printf("NDEBUG = no (Debug build)\n");
#endif
printf("DB_OWNER_NAME = \"%s\"\n", DB_OWNER_NAME);
}