notes on issues; grant schema usage
This commit is contained in:
		
							parent
							
								
									9356081662
								
							
						
					
					
						commit
						60f881a535
					
				| @ -48,7 +48,9 @@ setup | |||||||
|     * logid   (added if missing) |     * logid   (added if missing) | ||||||
| 
 | 
 | ||||||
| issues | issues | ||||||
|  - [ ] baseline request json is not depostiing correctly into the sql |  - [ ] use sql stored in table instead of pulling from file | ||||||
|  |  - [ ] include building all the route sql as setup step | ||||||
|  |  - [x] baseline request json is not depostiing correctly into the sql | ||||||
|  - [ ] what if you create a func table but some of the values are null? (orders without quotes) |  - [ ] what if you create a func table but some of the values are null? (orders without quotes) | ||||||
|  - [x] what if you want certain things like invoice numbers included in the baseline, is a func table necesary? no, just leave fkey null and no table will be setup |  - [x] what if you want certain things like invoice numbers included in the baseline, is a func table necesary? no, just leave fkey null and no table will be setup | ||||||
|  - [x] baseline needs to populate all columns in sequential order like the scale route |  - [x] baseline needs to populate all columns in sequential order like the scale route | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
|  | DROP SCHEMA fc CASCADE; | ||||||
| CREATE SCHEMA IF NOT EXISTS fc; | CREATE SCHEMA IF NOT EXISTS fc; | ||||||
|  | CREATE TABLE fc.dcard AS (SELECT * FROM tpsv.dcard_mapped) WITH DATA; | ||||||
| 
 | 
 | ||||||
| --DROP TABLE IF EXISTS fc.target_meta; | --DROP TABLE IF EXISTS fc.target_meta; | ||||||
| CREATE TABLE IF NOT EXISTS fc.target_meta ( | CREATE TABLE IF NOT EXISTS fc.target_meta ( | ||||||
| @ -85,6 +87,9 @@ CREATE TABLE fc.perd ( | |||||||
|     sspr text |     sspr text | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | GRANT USAGE ON SCHEMA fc TO api; | ||||||
|  | GRANT ALL ON ALL TABLES IN SCHEMA fc TO api; | ||||||
|  | 
 | ||||||
| COPY fc.perd (comp, fsyr, perds, perd, fspr, sdat, edat, drange, capr, ndays, ssyr, sspr) FROM stdin; | COPY fc.perd (comp, fsyr, perds, perd, fspr, sdat, edat, drange, capr, ndays, ssyr, sspr) FROM stdin; | ||||||
| 93	2008	12	1	0801	2008-01-01	2008-01-31	[2008-01-01,2008-01-31)	0801	31	2008	 08 | 93	2008	12	1	0801	2008-01-01	2008-01-31	[2008-01-01,2008-01-31)	0801	31	2008	 08 | ||||||
| 93	2008	12	2	0802	2008-02-01	2008-02-29	[2008-02-01,2008-02-29)	0802	29	2008	 09 | 93	2008	12	2	0802	2008-02-01	2008-02-29	[2008-02-01,2008-02-29)	0802	29	2008	 09 | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ FROM | |||||||
|     information_schema.columns  |     information_schema.columns  | ||||||
| WHERE  | WHERE  | ||||||
|     table_name = 'dcard'  |     table_name = 'dcard'  | ||||||
|     AND table_schema = 'tpsv' |     AND table_schema = 'fc' | ||||||
| ON CONFLICT ON CONSTRAINT target_meta_pk DO UPDATE SET | ON CONFLICT ON CONSTRAINT target_meta_pk DO UPDATE SET | ||||||
|     opos = EXCLUDED.opos |     opos = EXCLUDED.opos | ||||||
|     ,dtype = EXCLUDED.dtype; |     ,dtype = EXCLUDED.dtype; | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ BEGIN | |||||||
|         FROM |         FROM | ||||||
|             fc.target_meta tm |             fc.target_meta tm | ||||||
|         WHERE |         WHERE | ||||||
|             --only create master tables that don't have date as a foreign key |             --only create master tables that have a foreign key (that isn't a date) | ||||||
|             func IN (SELECT DISTINCT func FROM fc.target_meta WHERE fkey IS NOT NULL AND func IS NOT NULL AND dtype <> 'date') |             func IN (SELECT DISTINCT func FROM fc.target_meta WHERE fkey IS NOT NULL AND func IS NOT NULL AND dtype <> 'date') | ||||||
|         GROUP BY |         GROUP BY | ||||||
|             schema |             schema | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user