|
| 1 | +using System; |
| 2 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +namespace HomeSpeaker.Server2.Migrations |
| 7 | +{ |
| 8 | + /// <inheritdoc /> |
| 9 | + public partial class AddRadioStreams : Migration |
| 10 | + { |
| 11 | + /// <inheritdoc /> |
| 12 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 13 | + { |
| 14 | + migrationBuilder.CreateTable( |
| 15 | + name: "RadioStreams", |
| 16 | + columns: table => new |
| 17 | + { |
| 18 | + Id = table.Column<int>(type: "INTEGER", nullable: false) |
| 19 | + .Annotation("Sqlite:Autoincrement", true), |
| 20 | + Name = table.Column<string>(type: "TEXT", nullable: false), |
| 21 | + Url = table.Column<string>(type: "TEXT", nullable: false), |
| 22 | + FaviconFileName = table.Column<string>(type: "TEXT", nullable: true), |
| 23 | + PlayCount = table.Column<int>(type: "INTEGER", nullable: false), |
| 24 | + DisplayOrder = table.Column<int>(type: "INTEGER", nullable: false), |
| 25 | + CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false), |
| 26 | + LastPlayedAt = table.Column<DateTime>(type: "TEXT", nullable: true) |
| 27 | + }, |
| 28 | + constraints: table => |
| 29 | + { |
| 30 | + table.PrimaryKey("PK_RadioStreams", x => x.Id); |
| 31 | + }); |
| 32 | + |
| 33 | + // Seed the 22 existing streams |
| 34 | + migrationBuilder.InsertData( |
| 35 | + table: "RadioStreams", |
| 36 | + columns: new[] { "Name", "Url", "FaviconFileName", "PlayCount", "DisplayOrder", "CreatedAt", "LastPlayedAt" }, |
| 37 | + values: new object[,] |
| 38 | + { |
| 39 | + { "Church Music Stream", "https://nmcdn-lds.msvdn.net/icecastRelay/101156/GvaVK70/icecast?rnd=637109878513586401", null, 0, 1, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 40 | + { "Tabernacle Choir Stream", "https://nmcdn-lds.msvdn.net/icecastRelay/101158/3nGepF3/icecast?rnd=637109879815090752", null, 0, 2, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 41 | + { "Canal Espanol", "https://nmcdn-lds.msvdn.net/icecastRelay/101157/V2Pm3WE/icecast?rnd=637109879429639917", null, 0, 3, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 42 | + { "KBAQ", "https://kbaq.streamguys1.com/kbaq_mp3_128", null, 0, 4, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 43 | + { "Your Classical Radio", "https://ycradio.stream.publicradio.org/ycradio.aac", null, 0, 5, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 44 | + { "YourClassical MPR", "https://cms.stream.publicradio.org/cms.aac", null, 0, 6, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 45 | + { "Relax Radio", "https://relax.stream.publicradio.org/relax.aac", null, 0, 7, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 46 | + { "Lullabies", "https://lullabies.stream.publicradio.org/lullabies.aac", null, 0, 8, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 47 | + { "Choral Stream", "https://choral.stream.publicradio.org/choral.aac", null, 0, 9, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 48 | + { "Classical Favorites", "https://favorites.stream.publicradio.org/favorites.aac", null, 0, 10, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 49 | + { "Chamber Music", "https://chambermusic.stream.publicradio.org/chambermusic.aac", null, 0, 11, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 50 | + { "Peaceful Piano", "https://peacefulpiano.stream.publicradio.org/peacefulpiano.aac", null, 0, 12, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 51 | + { "Hygge", "https://hygge.stream.publicradio.org/hygge.aac", null, 0, 13, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 52 | + { "Focus", "https://focus.stream.publicradio.org/focus.aac", null, 0, 14, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 53 | + { "Concert Band", "https://concertband.stream.publicradio.org/concertband.aac", null, 0, 15, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 54 | + { "Classical Kids", "https://classicalkids.stream.publicradio.org/classicalkids.aac", null, 0, 16, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 55 | + { "Holiday Stream", "https://holiday.stream.publicradio.org/holiday_yc.aac", null, 0, 17, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 56 | + { "Classical 89", "https://radio.byub.org/classical89/classical89_aac", null, 0, 18, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 57 | + { "Guitar Stream", "https://guitar.stream.publicradio.org/guitar.aac", null, 0, 19, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 58 | + { "Madrigals", "https://streams.calmradio.com:14228/stream", null, 0, 20, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 59 | + { "Radio Clasique", "https://listen.radioking.com/radio/228241/stream/271810", null, 0, 21, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 60 | + { "Positively Baroque", "https://play.organlive.com:7020/128", null, 0, 22, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }, |
| 61 | + { "Adagio Radio (Madrid)", "https://stream.tunerplay.com/listen/adagioradio/adagioradio.mp3", null, 0, 23, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null } |
| 62 | + }); |
| 63 | + } |
| 64 | + |
| 65 | + /// <inheritdoc /> |
| 66 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 67 | + { |
| 68 | + migrationBuilder.DropTable( |
| 69 | + name: "RadioStreams"); |
| 70 | + } |
| 71 | + } |
| 72 | +} |
0 commit comments