DevSpaceHuntsville / WebsiteAndApi

This is the repo for the current website for the DevSpace Technical Conference in Huntsville, Alabama. There was a major architechure change from last year, so I archived the previous websaite and started fresh.
MIT License
10 stars 12 forks source link

Speaker details page shows sessions from previous years #41

Open freestylecoder opened 7 years ago

freestylecoder commented 7 years ago

The speaker details pages for individual speakers shows sessions from all years.

This is not necessarily bad, but we should, at least, separate the active sessions from the past sessions.

ProfessorTom commented 7 years ago

Hmm. Thinking about giving this the old college try.

I know you're way over-burdened right now, but I'd be curious to know if you have a way for me to seed my local database with enough data to test this and/or other features. Perhaps an INSERT query or two?

codewithtyler commented 7 years ago

Not sure if @freestylecoder uses the SQLite / SQL Server Compact Toolbox extension or not. If he does then he could easily give you a insert script of with data from production to test with. I've used it multiple times with great success.

freestylecoder commented 7 years ago

Hold off on this until a little later tonight. I have a change in the pipeline that will make this MUCH easier to replicate / test.

ProfessorTom commented 7 years ago

w00 h00!

freestylecoder commented 7 years ago

Ok, my changes just went live. This script on your local DB should get you testing, or at least get you close...

BEGIN TRANSACTION

DECLARE @UserID INTEGER;
DECLARE @PastTSID INTEGER;
DECLARE @FutureTSID INTEGER;

INSERT TimeSlots ( StartTime, EndTime ) VALUES ( DATEADD( d, -2, GETUTCDATE() ), DATEADD( d, -1, GETUTCDATE() ) );
SET @PastTSID = SCOPE_IDENTITY();

INSERT TimeSlots ( StartTime, EndTime ) VALUES ( DATEADD( y, 1, GETUTCDATE() ), DATEADD( y, 2, GETUTCDATE() ) );
SET @FutureTSID = SCOPE_IDENTITY();

INSERT Users ( EmailAddress, DisplayName, PasswordHash, Bio, Twitter, Website, Permissions, SessionToken, SessionExpires ) VALUES
( 'test@test.com', 'Test User', NULL, 'Test Bio', NULL, NULL, 1, NULL, NULL );
SET @UserID = SCOPE_IDENTITY();

INSERT Sessions ( UserId, Title, Abstract, Notes, Accepted, TimeSlotId, RoomId, SessionLength ) VALUES
( @UserID, 'Test Old Session', 'Test Old Abstract', 'Test Old Notes', 1, @PastTSID, NULL, 60 ),
( @UserID, 'Test New Session', 'Test New Abstract', 'Test New Notes', 1, @FutureTSID, NULL, 60 );

COMMIT TRANSACTION
ProfessorTom commented 6 years ago

I should really take a look at this...

ProfessorTom commented 6 years ago

Actually, is this still relevant?

freestylecoder commented 6 years ago

It's still relevant, in the fact that what I did was a hack.