Added data and migration scripts to migrate data from 1.0 DB.
This commit is contained in:
parent
e867732209
commit
d71f6003ef
222
resources/migration/old-songs-db.groovy
Normal file
222
resources/migration/old-songs-db.groovy
Normal file
@ -0,0 +1,222 @@
|
||||
services = [
|
||||
[id: 2, date: '2009-03-01', serviceType: 'SUN_PM'],
|
||||
[id: 3, date: '2009-03-08', serviceType: 'SUN_AM'],
|
||||
[id: 4, date: '2009-03-08', serviceType: 'SUN_PM'],
|
||||
[id: 5, date: '2009-03-22', serviceType: 'SUN_AM'],
|
||||
[id: 6, date: '2009-03-22', serviceType: 'SUN_PM'],
|
||||
[id: 7, date: '2009-04-08', serviceType: 'WED'],
|
||||
[id: 8, date: '2009-04-12', serviceType: 'SUN_AM'],
|
||||
[id: 9, date: '2009-04-12', serviceType: 'SUN_PM'],
|
||||
[id: 10, date: '2009-02-25', serviceType: 'WED'],
|
||||
[id: 11, date: '2009-04-22', serviceType: 'WED'],
|
||||
[id: 12, date: '2009-05-03', serviceType: 'SUN_AM'],
|
||||
[id: 13, date: '2009-05-10', serviceType: 'SUN_PM'],
|
||||
[id: 14, date: '2009-05-06', serviceType: 'WED'],
|
||||
[id: 17, date: '2009-04-26', serviceType: 'SUN_PM'],
|
||||
[id: 18, date: '2010-05-05', serviceType: 'WED'],
|
||||
[id: 19, date: '2010-05-09', serviceType: 'SUN_PM'],
|
||||
[id: 20, date: '2010-05-16', serviceType: 'SUN_PM'],
|
||||
[id: 21, date: '2010-08-15', serviceType: 'SUN_PM'],
|
||||
[id: 22, date: '2011-03-13', serviceType: 'SUN_AM'],
|
||||
[id: 23, date: '2011-03-13', serviceType: 'SUN_PM'],
|
||||
[id: 24, date: '2011-03-16', serviceType: 'WED'],
|
||||
[id: 25, date: '2011-03-20', serviceType: 'SUN_AM'],
|
||||
[id: 26, date: '2015-02-08', serviceType: 'SUN_PM'],
|
||||
[id: 27, date: '2015-01-07', serviceType: 'WED'],
|
||||
[id: 28, date: '2015-02-11', serviceType: 'WED'],
|
||||
[id: 29, date: '2014-02-02', serviceType: 'WED']]
|
||||
|
||||
|
||||
songs = [
|
||||
[id: 1, name: 'Welcome Holy Spirit', artists: ['Mark Condon']],
|
||||
[id: 2, name: 'We Worship You', artists: ['']],
|
||||
[id: 3, name: "Let's Sing Praises to our God", artists: ['Traditional']],
|
||||
[id: 4, name: 'I am a Friend of God', artists: ['Israel Houghton']],
|
||||
[id: 5, name: 'Blessed Assurance', artists: ['Frances J. Crosby']],
|
||||
[id: 6, name: 'Sing Unto the Lord a New Song', artists: ['Becky Fender']],
|
||||
[id: 7, name: 'Mighty God', artists: ['']],
|
||||
[id: 8, name: 'Here I Am To Worship', artists: ['Tim Hughes', ' Chris Tomlin, Michael W. Smith']],
|
||||
[id: 9, name: 'Worthy', artists: ['']],
|
||||
[id: 10, name: 'Come and Let Us Sing', artists: ['Israel Houghton']],
|
||||
[id: 11, name: 'I Feel the Joy', artists: ['']],
|
||||
[id: 12, name: 'Healer', artists: ['Kari Jobe', ' Hillsong']],
|
||||
[id: 13, name: 'This World is Not My Home', artists: ['Ricky Skaggs']],
|
||||
[id: 14, name: 'Praise the Lord With Me', artists: ['Carlton Pearson', ' T.D. Jakes']],
|
||||
[id: 15, name: 'I Am Free', artists: ['Newsboys']],
|
||||
[id: 16, name: 'You Are Great', artists: ['Juanita Bynum']],
|
||||
[id: 17, name: 'Lion of Judah', artists: ['Eddie James', ' Beverly Crawford']],
|
||||
[id: 18, name: 'We Are Standing on Holy Ground', artists: ['Bill Gaither']],
|
||||
[id: 19, name: 'Draw Me Nearer', artists: ['Meredith Andrews']],
|
||||
[id: 20, name: 'Nothing but the Blood', artists: ['Robert Lowry']],
|
||||
[id: 21, name: 'I Will Search For You', artists: ['Israel Houghton']],
|
||||
[id: 22, name: 'This is How We Praise Him', artists: ['']],
|
||||
[id: 23, name: 'We Have Overcome', artists: ['Israel Houghton']],
|
||||
[id: 24, name: 'Breakthrough', artists: ['']],
|
||||
[id: 25, name: 'He is Here', artists: ['Martha Munizzi']],
|
||||
[id: 26, name: 'Lead Me Lord', artists: ['Brooklyn Tabernacle Choir']],
|
||||
[id: 28, name: 'Power in the Name', artists: ['Gateway College']],
|
||||
[id: 29, name: 'Praise the Lord', artists: ['']],
|
||||
[id: 30, name: 'Ready Now', artists: ['Desperation Band']],
|
||||
[id: 31, name: 'Come Into This House', artists: ['Carlton Pearson']],
|
||||
[id: 32, name: "You're the One", artists: ['']],
|
||||
[id: 33, name: 'How Great is Our God', artists: ['Chris Tomlin']],
|
||||
[id: 34, name: 'We Will Worship the Lamb of Glory', artists: ['Dennis Jernigan']],
|
||||
[id: 35, name: 'Let It Rise', artists: ['Big Daddy Weave']],
|
||||
[id: 36, name: 'God Is My Refuge And Strength', artists: ['']],
|
||||
[id: 37, name: 'Shout to the Lord', artists: ['Darlene Zschech', ' Chris Tomlin', ' Hillsong']],
|
||||
[id: 38, name: 'In the Presence of Jehovah', artists: ['Damaris Carbaugh']],
|
||||
[id: 39, name: 'In the Sanctuary', artists: ['']],
|
||||
[id: 40, name: 'Mighty To Save', artists: ['Hillsong', ' Michael W. Smith']],
|
||||
[id: 41, name: 'Rejoice', artists: ['']],
|
||||
[id: 42, name: 'He Lives', artists: ['']],
|
||||
[id: 43, name: 'Breathe', artists: ['']],
|
||||
[id: 44, name: 'Healing Rain', artists: ['Michael W. Smith']],
|
||||
[id: 51, name: 'Lord I Praise Your Name', artists: ['']],
|
||||
[id: 46, name: "It's a New Season", artists: ['']],
|
||||
[id: 47, name: 'Let Us Have a Little Talk With Jesus', artists: ['Jimmy Dean']],
|
||||
[id: 48, name: 'Lord You Are Good', artists: ['']],
|
||||
[id: 49, name: "Enemy's Camp", artists: ['']],
|
||||
[id: 50, name: 'Whose Report Will You Believe?', artists: ['']],
|
||||
[id: 52, name: 'Lord We Give You Glory', artists: ['']],
|
||||
[id: 53, name: 'Revelation Song', artists: ['Jennie Lee Riddle', ' Phillips, Craig and Dean', ' Kari Jobe']],
|
||||
[id: 54, name: 'Moving Forward', artists: ['']],
|
||||
[id: 55, name: 'Let It Rain', artists: ['']],
|
||||
[id: 56, name: 'Say So', artists: ['']],
|
||||
[id: 57, name: 'We Praise Your Name', artists: ['']],
|
||||
[id: 58, name: 'You Never Let Go', artists: ['Matt Redman']],
|
||||
[id: 59, name: "I'd Rather Have Jesus", artists: ['']],
|
||||
[id: 60, name: 'Everybody Will Be Happy Over There', artists: ['E.M. Bartlett']],
|
||||
[id: 61, name: 'Awesome God', artists: ['']],
|
||||
[id: 62, name: 'Whisper His Name', artists: ['Deluge']],
|
||||
[id: 63, name: 'How He Loves Us', artists: ['John Mark McMillan', ' David Crowder Band']],
|
||||
[id: 64, name: 'Lord I Lift Up My Hands', artists: ['Trent Corey']],
|
||||
[id: 65, name: 'Give Him the Glory', artists: ['']],
|
||||
[id: 66, name: 'Blessed Be The Name Of The Lord', artists: ['']],
|
||||
[id: 67, name: 'Heart of Worship', artists: ['Matt Redman']],
|
||||
[id: 68, name: 'Freedom Is', artists: ['']],
|
||||
[id: 69, name: 'I Give My All', artists: ['']],
|
||||
[id: 70, name: 'Come Unto Me', artists: ['']],
|
||||
[id: 71, name: 'Shout With A Voice Of Triumph', artists: ['']],
|
||||
[id: 72, name: 'Oh, How I Love Jesus', artists: ['']],
|
||||
[id: 73, name: "It Ain't Over", artists: ['Maurette Brown Clark']],
|
||||
[id: 74, name: 'Our God', artists: ['']],
|
||||
[id: 75, name: "Can't Stop Praising His Name", artists: ['']],
|
||||
[id: 76, name: 'Lord I Lift Your Name On High', artists: ['Petra', ' Mercy Me']],
|
||||
[id: 77, name: 'We Are Here To Worship You', artists: ['']],
|
||||
[id: 78, name: 'I Feel Jesus', artists: ['']],
|
||||
[id: 79, name: 'It Is You', artists: ['Newsboys']],
|
||||
[id: 80, name: 'I Surrender', artists: ['Hillsong']],
|
||||
[id: 81, name: 'Our Father', artists: ['Israel Houghton']],
|
||||
[id: 82, name: 'Kingdom Come', artists: ['']],
|
||||
[id: 83, name: 'Father Along', artists: ['']],
|
||||
[id: 84, name: "We'll Understand It Better By and By", artists: ['Charles Albert Tindley; arr. by F.A. Clark']],
|
||||
[id: 85, name: 'Because Of You', artists: ['Eddie James']]]
|
||||
|
||||
performances = [
|
||||
[serviceId: 7, songId: 34, pianist: 'Rachel Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 7, songId: 33, pianist: 'Rachel Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 7, songId: 32, pianist: 'Rachel Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 10, songId: 3, pianist: 'Rachel Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 10, songId: 2, pianist: 'Rachel Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 2, songId: 8, pianist: 'Nicole Brantley', organist: 'Jared Wood', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 2, songId: 9, pianist: 'Nicole Brantley', organist: 'Jared Wood', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 3, songId: 10, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 3, songId: 11, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 3, songId: 12, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 3, songId: 13, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 12, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 14, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 15, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 16, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 17, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 4, songId: 18, pianist: 'Jared Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 5, songId: 19, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 5, songId: 20, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 5, songId: 21, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 5, songId: 22, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 5, songId: 23, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Chris Green', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 30, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 24, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 10, songId: 1, pianist: 'Rachel Wood', organist: null, bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 7, songId: 31, pianist: 'Rachel Wood', organist: 'Connie Bernard', bassist: 'Jonathan Bernard', drummer: 'Jared Wood', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 25, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 2, songId: 7, pianist: 'Nicole Brantley', organist: 'Jared Wood', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 2, songId: 4, pianist: 'Nicole Brantley', organist: 'Jared Wood', bassist: 'Jonathan Bernard', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 26, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 81, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 28, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 6, songId: 29, pianist: 'Jared Wood', organist: 'Connie Bernard', bassist: 'Edgar Zarate', drummer: 'Daniel Bernard', guitarist: null, leader: null],
|
||||
[serviceId: 11, songId: 36, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 11, songId: 35, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 11, songId: 37, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 11, songId: 38, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 12, songId: 11, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 12, songId: 39, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 8, songId: 40, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 8, songId: 41, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 8, songId: 42, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 13, songId: 7, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 13, songId: 81, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 17, songId: 43, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 17, songId: 44, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 17, songId: 46, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 17, songId: 47, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 17, songId: 48, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 18, songId: 49, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 18, songId: 50, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 18, songId: 16, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 20, songId: 51, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 20, songId: 52, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 20, songId: 28, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 20, songId: 14, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 20, songId: 53, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 56, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 44, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 54, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 55, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 57, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 21, songId: 58, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 13, songId: 68, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 14, songId: 67, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 14, songId: 65, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 14, songId: 66, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 12, songId: 64, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 12, songId: 63, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 61, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 59, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 46, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 54, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 23, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 19, songId: 62, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 13, songId: 12, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 13, songId: 58, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 22, songId: 70, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 22, songId: 69, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 22, songId: 13, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 75, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 44, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 73, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 72, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 74, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 23, songId: 71, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 24, songId: 61, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 24, songId: 78, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 24, songId: 76, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 24, songId: 77, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 25, songId: 10, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 25, songId: 73, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 25, songId: 79, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 25, songId: 6, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 8, songId: 53, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 27, songId: 80, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 27, songId: 14, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 27, songId: 23, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 28, songId: 83, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 28, songId: 82, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 28, songId: 81, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 28, songId: 84, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 29, songId: 85, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 29, songId: 57, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null],
|
||||
[serviceId: 29, songId: 62, pianist: null, organist: null, bassist: null, drummer: null, guitarist: null, leader: null]]
|
||||
|
||||
|
50
src/migration/migrate.groovy
Normal file
50
src/migration/migrate.groovy
Normal file
@ -0,0 +1,50 @@
|
||||
import com.zaxxer.hikari.HikariConfig
|
||||
import com.zaxxer.hikari.HikariDataSource
|
||||
import com.jdbernard.nlsongs.db.NLSongsDB
|
||||
import com.jdbernard.nlsongs.model.*
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
sdf = new SimpleDateFormat('yyyy-MM-dd')
|
||||
hcfg = new HikariConfig("/home/jdbernard/projects/new-life-songs/src/main/webapp/WEB-INF/classes/newlifesongs.properties")
|
||||
|
||||
makeService = { svcRow ->
|
||||
Service svc = new Service()
|
||||
svc.date = sdf.parse(svcRow.date)
|
||||
svc.serviceType = svcRow.serviceType
|
||||
return svc }
|
||||
|
||||
pushService = { svcRow ->
|
||||
Service svc = makeService(svcRow)
|
||||
svc = songsDB.create(svc)
|
||||
svcRow.newId = svc.id
|
||||
return svc.id }
|
||||
|
||||
makeSong = { songRow ->
|
||||
Song song = new Song()
|
||||
song.name = songRow.name
|
||||
song.artists = songRow.artists
|
||||
return song }
|
||||
|
||||
pushSong = { songRow ->
|
||||
Song song = makeSong(songRow)
|
||||
song = songsDB.create(song)
|
||||
songRow.newId = song.id
|
||||
return song.id }
|
||||
|
||||
makePerformance = { perfRow ->
|
||||
Performance perf = new Performance()
|
||||
perfRow.each { k, v -> perf[k] = v }
|
||||
|
||||
// Replace with new DB ids
|
||||
perf.serviceId = services.find { it.id == perf.serviceId }.newId
|
||||
perf.songId = songs.find { it.id == perf.songId }.newId
|
||||
return perf }
|
||||
|
||||
pushPerformance = { perfRow ->
|
||||
Performance perf = makePerformance(perfRow)
|
||||
return songsDB.create(perf) }
|
||||
|
||||
makeSongsDB = {
|
||||
hds = new HikariDataSource(hcfg)
|
||||
songsDB = new NLSongsDB(hds)
|
||||
return songsDB }
|
Loading…
Reference in New Issue
Block a user